By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 701 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

Socket question - remote close or empty message?

P: n/a
From MSDN dox:

WinSock select():
For connection-oriented sockets, readability can also indicate that a
request to close the socket has been received from the peer. If the
virtual circuit was closed gracefully, and all data was received, then a
recv will return immediately with zero bytes read.

..NET Socket.Select():
Readability can also indicate whether the remote Socket has shut down
the connection; in that case a call to Receive will return immediately,
with zero bytes returned.

Now for the question:
It's possible to send an empty message (socket.Send(new byte[]{}).
How on earth would a receving socket distinguish between this and a
remote shutdown?

Jul 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.