Detect socket closed

Problems with WiFi, SQLite ,Bluetooth, WiMax, Proxies, etc...

Detect socket closed

Postby MrSnowflake » Fri Nov 14, 2008 12:12 am

How can I detect when a Socket connection got closed from the other side? I have this client-server app, and when the client calls socket.close(), the server's client socket still has isConnected()==true. How come? Shouldn't this also be closed, as the tcp connection is closed?
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Top

Postby MrSnowflake » Fri Nov 14, 2008 12:07 pm

Apparently this should be done by schecking inputStream.readx() if it's null (in case of reference types) then the connection is broken.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Top

Return to Networking & Database Problems

Who is online

Users browsing this forum: No registered users and 4 guests