Advertisement
Guest User

Untitled

a guest
May 19th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.61 KB | None | 0 0
  1. TCPStartup()
  2. $MAINSOCKET = TCPListen(@IPAddress1,9999)
  3. $OPPONENTIP = InputBox("","Bitte die IP des anderen PCs eingeben!")
  4. If @error Then Exit
  5.  
  6. While 1
  7.     $TEMPSOCKET = TCPConnect($OPPONENTIP,9999)
  8.     If $TEMPSOCKET <> -1 Then ExitLoop
  9.     Sleep(100)
  10. WEnd
  11.  
  12. HotKeySet("{ESC}","_Exit")
  13. HotKeySet("^w","_Send")
  14.  
  15. While 1
  16.     $TEMPRECV = TCPRecv($TEMPSOCKET,8192)
  17.     If $TEMPRECV <> "" Then TrayTip("Daten empfangen!",$TEMPRECV,1)
  18.     Sleep(100)
  19. WEnd
  20.  
  21. func _Send()
  22.     $DATA = InputBox("Senden","Text eingeben!")
  23.     If @error Then Return
  24.     TCPSend($TEMPSOCKET,$DATA)
  25. EndFunc
  26.  
  27. func _Exit()
  28.     TCPShutdown()
  29.     Exit
  30. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement