Guest User

Untitled

a guest
Jun 8th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.99 KB | None | 0 0
  1. ;client
  2.  
  3. Run("sdffsd.exe")
  4. Sleep(10000)
  5. MsgBox(0,"","")
  6. TCPStartup()
  7.  
  8. $socket = TCPConnect("127.0.0.2", 4321)
  9. $socket2 = TCPListen("127.0.0.3", 4322)
  10.  
  11. If $socket = -1 Then ;
  12.     MsgBox(16, "Error", "Die Verbindung zum Server konnte nicht hergestellt werden!")
  13. EndIf
  14.  
  15. $sendedBytes = TCPSend($socket, "1")
  16.  
  17. While 1
  18.     $acceptedSocket = TCPAccept($socket2)
  19.      ;MsgBox(0,"",$acceptedSockeT)
  20.     If $acceptedSocket <> -1 Then
  21.         $receivedData = TCPRecv($acceptedSocket, 1024)
  22.         MsgBox(0,"",$receiveddata)
  23.         Exit
  24.     EndIf
  25. WEnd
  26.  
  27.  
  28.  
  29.  
  30.  
  31. TCPCloseSocket($socket)
  32. TCPShutdown()  
  33.  
  34.  
  35. ;server
  36.  
  37. TCPStartup()
  38.  
  39. $mainsocket = TCPListen("127.0.0.2", 4321)
  40.  
  41.  
  42.  
  43. While 1  
  44.     $acceptedSocket = TCPAccept($mainsocket)
  45.      
  46.     If $acceptedSocket <> -1 Then
  47.         $receivedData = TCPRecv($acceptedSocket, 1024)
  48.         $socket = TCPConnect("127.0.0.3", 4322)
  49.         $a = TCPSend($socket,"hallo")
  50.             ;MsgBox(0,"",$a)
  51.         ;TCPCloseSocket($acceptedSocket)
  52.     EndIf
  53. WEnd
Add Comment
Please, Sign In to add comment