Java Socket Disconnect Reporting vs. C# Disconnection

Posted by ikurtz on Stack Overflow See other posts from Stack Overflow or by ikurtz
Published on 2010-05-10T18:54:48Z Indexed on 2010/05/10 21:14 UTC
Read the original article Hit count: 283

Filed under:
|
|
|
|

in C# when a sockets connection is terminated the other node is informed of this before terminating the link thus the remaning node can update the connection status.

in Java when i terminate a communication link the other node keeps reporting the connection as valid.

do i need to implement a read cycle (makes sense) that reports the connection as lost when it recieves a -1 during read (in C# this is 0 i think)?

thank you for your insight.

EDIT: thanks to you both. as i suspected and mentioned in my post that an additional check is required to confirm the connected state of a connection.

© Stack Overflow or respective owner

Related posts about java

Related posts about c#