Question About Network Clients
Posted: Fri Mar 31, 2006 3:38 am
I have a client program, essentially the same as in the PB example, but I need to know how to make it stop listening if the server dies during the connection, or the server is being extremely slow? Can someone fill in the blanks for me?
Thanks in advance,
Alex
Code: Select all
ConnectionID = OpenNetworkConnection("127.0.0.1", Port)
If ConnectionID
SendNetworkString(ConnectionID,CLIENT_VALIDATION_STRING$)
; Here is where I need the help. If the server dies before I
; receive my data, how do I know? Can I set a
; timeout somehow, or is there a Linux thing I can check?
RESULT=ReceiveNetworkData(ConnectionID, *Buffer, 100)
F00$=PeekS(*Buffer)
Else
End
EndIf
Alex