dnsi Posted October 25, 2006 Posted October 25, 2006 How do you detect a closed socket. For example: If a user logged on to your server then they loged off. How do you detect the server going off without the client actucally telling the server it had exited? My Programs:Flip-Flop File Encryption SysyemMULTIPLAYER-SOCKETSERVERHide An Archive In A Picture
Rad Posted October 26, 2006 Posted October 26, 2006 Have the server ping the socket, if theres no response it probrably disconnected
dnsi Posted October 28, 2006 Author Posted October 28, 2006 Ok... Ill try that... My Programs:Flip-Flop File Encryption SysyemMULTIPLAYER-SOCKETSERVERHide An Archive In A Picture
cppman Posted October 29, 2006 Posted October 29, 2006 (edited) Success: Returns number of bytes sent to the connected socket. Failure: Returns 0 and set @error according to Windows API WSAGetError return. Try sending data, check if there is an error... check @error, and work accordingly.. while (TCPSend($socket, "stay-alive") > 0) ;do your code wend ;You no longer have a client. Edited October 29, 2006 by CHRIS95219 Miva OS Project
dnsi Posted October 29, 2006 Author Posted October 29, 2006 Man it works My Programs:Flip-Flop File Encryption SysyemMULTIPLAYER-SOCKETSERVERHide An Archive In A Picture
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