Hello, I'm trying my hand at a simple TCP server and client but I have a bit of a worry! I create a simple GUI to return the error code following the TCPStartUp command and its returning an error! I have tried using some example TCP Scripts too which don't seem to work properly. Would someone mind having a look at my code below and tell me if the TCPStartUp should be working? Should it be returning errorcode 1? And should my text steps be TCP Listen > TCP Accept > TCP Recieve? I'm a bit of a noob so any help would be hugely appreciated #include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt('GUIonEventMode', 1)
$GUI = GUICreate("S.M.I Server", 472, 311, 751, 312)
$Content = GUICtrlCreateEdit("", 8, 8, 313, 289, BitOR($GUI_SS_DEFAULT_EDIT,$ES_READONLY))
GUISetState(@SW_SHOW)
GUICtrlSetData($Content, "Content")
TCPStartup()
IF @error == 1 Then
GUICtrlSetData($content, "TCP Services started with: " & @Error)
Else
GUICtrlSetData($content, "TCP Services failed with error: " & @error)
EndIf
While 1
GUISetOnEvent($GUI_EVENT_CLOSE, "quit", $GUI)
WEnd
Func quit()
TCPShutdown()
GUICtrlSetData($content, "TCP Shut Down: " & @error)
sleep(700)
Exit
EndFunc