SocketImpl::receiveBytes question/suggestion

Please post support and help requests here.
merdem
Posts: 14
Joined: 19 Jul 2006, 22:28

SocketImpl::receiveBytes question/suggestion

Postby merdem » 11 Aug 2006, 18:06

Hello,

Examining the SocketImpl class, I found out that the SocketImpl::receiveBytes method does not report a graceful close from peer.

The Unix documentation of recv() says it returns 0 in such a case.

Is this a design decision? Is it intentionally left to the user to check for this case? Wouldn't it be better to check it in SocketImpl::receiveBytes and throw an exception?

By the way, congrats on this excellent library. I am still amazed.

Murat

guenter
Posts: 1184
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: SocketImpl::receiveBytes question/suggestion

Postby guenter » 11 Aug 2006, 18:42

For receiveBytes(), a return value of 0 means a graceful close from the peer (I have clarified the documentation). Throwing an exception in this case would be bad design, because a graceful close is usually an expected condition, in contrast to an aborted or reset connection (in which case an exception is thrown).


Return to “Support”

Who is online

Users browsing this forum: No registered users and 1 guest