Guest User

Server

a guest
Oct 12th, 2013
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.67 KB | None | 0 0
  1. #include <GUIConstantsEx.au3>
  2. #include <WindowsConstants.au3>
  3.  
  4. GUICreate("Form1", 615, 227)
  5. $Mainlist = GUICtrlCreateList("PC Name|Operating system", -1, -1, 615, 227)
  6. GUISetState()
  7. Global $TCPAccept
  8. TCPStartup()
  9. $MainSocket = TCPListen(@IPAddress1, 1234)
  10.  
  11. While 1
  12.         $TCPRecv = TCPRecv($TCPAccept, 999999999)
  13.         If @error Then _TCPAccept()
  14.         If $TCPRecv <> "" Then GUICtrlSetData($Mainlist, $TCPRecv)
  15.         Sleep(100)
  16. WEnd
  17.  
  18. Func _TCPAccept()
  19.         GUICtrlSetData($Mainlist, "")
  20.         Do
  21.                 $TCPAccept = TCPAccept($MainSocket)
  22.         Until $TCPAccept <> -1
  23.         GUICtrlSetData($Mainlist, "")
  24. EndFunc   ;==>_TCPAccept
Advertisement
Add Comment
Please, Sign In to add comment