ein kolege hat das server programm
und ich habe die server datei auf sein pc laufen
und seine ip genommen die haben wir von whatsmyip
dennoch wenn ich das client script starte dann kommt ne fehlermeldung
Server script :
PHP Code:
#include <GUIConstants.au3>
;FileCreateShortcut( @ScriptFullPath, @StartupDir & "\" & @ScriptName & ".ink" )
Opt("TrayIconHide",1)
Break (0)
$ServerIP = @IPAddress1
$Port = 33891
TCPStartup()
$MainSocket = TCPListen($ServerIP, $Port)
If $MainSocket = -1 Then Exit
$ConnectedSocket = -1
While 1
If $ConnectedSocket = -1 Then
Do
TrayTip("Waiting for Connection ...","",1)
$ConnectedSocket = TCPAccept($MainSocket)
Until $ConnectedSocket <> -1
EndIf
While 1
$recv = TCPRecv($ConnectedSocket, 2048)
If @error Then
$ConnectedSocket = -1
ExitLoop
EndIf
If $recv <> "" Then
TrayTip("Incomming Command", $recv, 1)
_CommandToAction($recv)
EndIf
WEnd
WEnd
TCPShutdown()
PHP Code:
#include <GUIConstants.au3>
$ServerIP = 127.0.0.1
;$DNS = ""
;$ServerIP = TCPNameToIP($DNS)
$Port = 33891
TCPStartup()
$ConnectedSocket = TCPConnect($ServerIP,$Port)
If @error Then
MsgBox(4112, "Error", "TCP Connect failed with WSA error: " & @error)
Else
While 1
$Data = InputBox("Daten zum server senden", "Bitte daten eingeben mit | abtrennnen : ")
If @error or $Data = "" Then ExitLoop
TCPSend($ConnectedSocket, $Data)
If @error Then ExitLoop
#cs
$incomming = TCPRecv($ConnectedSocket, 2048)
if $incomming <> "" Then
$incomming = StringSplit($incomming, "|")
MsgBox(0, "Incoming Message", $incomming)
$incomming = ""
EndIf
#ce
WEnd
EndIf
$ServerIP =^ ERROR
Line7