Hi,
also mein server soll kleinere text emppfangen, das tut er auch.
Nur wenn mal nix kommt dann wartet er immer och bis was kommt und so muss ich ihn neu starten.
Ich hab auch schon das hier versucht :
Spoiler anzeigen
TCPStartup()
$Main = TCPListen($IP, $PORT, $MAXUSE)
If $Main = @error Then Exit
While 1
$Client = TCPAccept($Main)
if $Client >= 0 Then
$iIP = SocketToIP($Client)
ConsoleWrite("Client Connect")
$get = 0
$time = 0
$geted = "nothing"
While $get <> "" or $time = 100000
$get = TCPRecv($Client, 2048)
if $get <> "" Then
ConsoleWrite("get :"&$geted)
GUICtrlSetData($geted,$geted)
GUICtrlSetData($time, 100000)
EndIf
GUICtrlSetData($time,+1)
WEnd
ConsoleWrite($geted)
EndIf
WEnd
[/autoit] [autoit][/autoit] [autoit]; Function to return IP Address from a connected socket.
;----------------------------------------------------------------------
Func SocketToIP($SHOCKET)
Local $sockaddr, $aRet
$sockaddr = DllStructCreate("short;ushort;uint;char[8]")
[/autoit] [autoit][/autoit] [autoit]$aRet = DllCall("Ws2_32.dll", "int", "getpeername", "int", $SHOCKET, _
"ptr", DllStructGetPtr($sockaddr), "ptr", DllStructGetSize($sockaddr))
If Not @error And $aRet[0] = 0 Then
$aRet = DllCall("Ws2_32.dll", "str", "inet_ntoa", "int", DllStructGetData($sockaddr, 3))
If Not @error Then $aRet = $aRet[0]
Else
$aRet = DllCall("Ws2_32.dll", "str", "inet_ntoa", "int", DllStructGetData($sockaddr, 3))
$aRet = $aRet[0]
EndIf
$sockaddr = 0
[/autoit] [autoit][/autoit] [autoit]Return $aRet
EndFunc ;==>SocketToIP
nur vergeht die zeit unheimlich schnell und mein if abfrage kommt nicht mit...^^
kann mir einer zu was bssererm raten (was auch funktioniert)
ach ja und die SocketToIP() funktion geht auch nich (hab ich aus helpfile)
mfg Jiyan006