bigfattoby 0 Posted August 20, 2011 Hey guys, ive got those two scripts here. the first is my server and the secound is the client. the problem is that after ive send 1 msg from my client my server closes. How can i avoid this? TCPStartup() $TCPL = TCPListen(@IPAddress1, 403) Do $TCPA = TCPAccept($TCPL) Until $TCPA <> -1 Do $TCPR = TCPRecv($TCPA, 1000000) Until $TCPR <> "" MsgBox(0, "Data recived", $TCPR) #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= TCPStartup() $TCPC = TCPConnect(@IPAddress1, 403) Global $Form1 = GUICreate("Form1", 292, 50, 192, 124) Global $Input1 = GUICtrlCreateInput("Input1", 16, 16, 177, 21) Global $Button1 = GUICtrlCreateButton("Button1", 200, 16, 73, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() If $TCPC = -3 Then Exit If $nMsg = -3 Then Exit If $nMsg = $Button1 Then button1() WEnd Func button1() $Iread = GUICtrlRead($Input1) TCPSend($TCPC, $Iread) EndFunc Getting hang on the basic, still much to learn.If I take high class, taking high test im getting highscore right? Share this post Link to post Share on other sites
hannes08 39 Posted August 20, 2011 Try: TCPStartup() $TCPL = TCPListen(@IPAddress1, 403) Do $TCPA = TCPAccept($TCPL) Until $TCPA <> -1 While 1 Do $TCPR = TCPRecv($TCPA, 1000000) Until $TCPR <> "" MsgBox(0, "Data recived", $TCPR) Wend Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Share this post Link to post Share on other sites