fridojet
fridojet

Reputation: 1296

Chrome Socket API: How To Create a Half-Open TCP Socket

The Chrome Socket API allows us to disconnect() from a TCP socket. But how can I decide if I want the socket to stay half-open or not after the other side has sent a FIN packet? Thanks.

Upvotes: 1

Views: 554

Answers (1)

user207421
user207421

Reputation: 310957

If you've received a FIN packet it already is half-open, at best. You can only send data from your end, not receive it, and you mightn't even be able to send if the peer has closed completely. You would have to try it. Note that the resulting error (connection reset by peer) may be delayed due to buffering.

Upvotes: 1

Related Questions