Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;client
- TCPStartup()
- $socket = TCPConnect("134.0.0.2", 4321)
- If $socket = -1 Then ;
- MsgBox(16, "Error", "Die Verbindung zum Server konnte nicht hergestellt werden!")
- EndIf
- $sendedBytes = TCPSend($socket, "1")
- While 1
- $a = TCPRecv($socket,1000)
- If $a <> -1 And Not($a="") Then MsgBox(0,"",$a)
- WEnd
- TCPCloseSocket($socket)
- TCPShutdown()
- ;server
- TCPStartup()
- ;$mainsocket = TCPListen("134.0.0.2", 4321)
- $mainsocket = TCPListen("127.0.0.2", 4321)
- While 1
- $acceptedSocket = TCPAccept($mainsocket)
- If $acceptedSocket <> -1 Then
- $receivedData = TCPRecv($acceptedSocket, 1024)
- $a = TCPSend($acceptedSocket,"hallo")
- MsgBox(0,"",$a)
- ;TCPCloseSocket($acceptedSocket)
- EndIf
- WEnd
Add Comment
Please, Sign In to add comment