Wb-FreeKill Posted April 10, 2005 Share Posted April 10, 2005 (edited) Ive done some coding on Larry's Client/Server.. but ive messed something up. How do the client know when the server shutsdown? Like even when you shut the server down in task manager, the client says (Server disconnected).. how do it know? ;-------------------------------------------- ; Server Exit ;-------------------------------------------- If $ret[0] < 0 Then WinsetTitle($GUI,"Server Disconnected") EndIf When does $ret[0] become <0 ? Edited April 10, 2005 by Wb-FreeKill Link to comment Share on other sites More sharing options...
Wb-FreeKill Posted April 10, 2005 Author Share Posted April 10, 2005 umm anyone? Link to comment Share on other sites More sharing options...
TuMbLeWeEd Posted April 11, 2005 Share Posted April 11, 2005 umm anyone?<{POST_SNAPBACK}>Every call to the Au3Xtra.dll that fails return a value <0, meaning:$ret = DLLCall("au3xtra.dll","int","TCPRecv", "int", $socket, "str", "", "int", 512 )$socket = the socket you connected toNow when the server is down the TCP/IP protocol will close the socket and is no longer valid and the dll returns a value < 0 to let you know the server is down :-)Can be wrong, sounds logical to me My AutoIt stuffChatBichProjectSelectorWindow control grabberUsefull LinksPort forwarding with routers Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now