habe mal eben zwei tcp skripte erstellt, nur irgendwie kommt zwar die msgbox dass der string gesendet wurde, aber ich empfange ihn beim Server nicht...warum??
Server:
Spoiler anzeigen
;=============================================================
; SERVER
;============================================================
#include
_GetIP()
Global Const $sIP = @IPAddress1
Global Const $iPort = 31758
Global Const $iMaxLen = 2048
Global $Socket = ""
Global $Client[999]
$MainSocket = TCPListen($sIP, $iPort)
$zahl = -1
While 1
$ConnectedSocket = TCPAccept($MainSocket)
If $ConnectedSocket > -1 Then
$zahl = $zahl + 1
$Client[$zahl] = $Socket ;neuer Client wird in einem Array gespeichert
EndIf
If $zahl > -1 Then ;falls Verbindung besteht
For $i = 0 To $zahl
$Recv = TCPRecv($Client[$i], $iMaxLen)
If $Recv <> "" Then
ConsoleWrite($Recv & @LF)
EndIf
Next
EndIf
WEnd
[/autoit]Client:
Spoiler anzeigen
;=============================================================
; CLIENT
;============================================================
#include
[/autoit] [autoit][/autoit] [autoit]Global Const $sIP = @IPAddress1;_GetIP()
Global Const $iPort = 31758
TCPStartup()
[/autoit] [autoit][/autoit] [autoit]$ConnectedSocket = TCPConnect($sIP, $iPort)
If $ConnectedSocket = -1 Then
MsgBox(0, "", "Keine Verbindung hergestellt!")
Exit
Else
For $i = 1 To 10
TCPSend($ConnectedSocket, "Test String")
Sleep(20)
Next
MsgBox(0, "", "TCP Send erfolgreich")
TCPShutdown()
EndIf