Page 1 of 1

ReceiveNetworkData() returns -1, should be 0

Posted: Fri Sep 07, 2012 9:50 pm
by RichAlgeni
When a client socket connects to a server socket, but doesn't send any data, ReceiveNetworkData() returns a '-1', instead of 0, even though the socket is still connected.

Please see towards the bottom of: http://purebasic.fr/english/viewtopic.p ... 30#p390130

and: http://purebasic.fr/english/viewtopic.p ... 31#p390131

Re: ReceiveNetworkData() returns -1, should be 0

Posted: Tue Sep 11, 2012 11:29 pm
by Warmonger
Second, it would be nice if ReceiveNetworkData() returns 0 if no bytes are received. And -1 for everything else (errors). Returning -1 by default only makes using the function that much more difficult when it comes to error handling.

Re: ReceiveNetworkData() returns -1, should be 0

Posted: Wed Sep 12, 2012 1:08 am
by RichAlgeni
I decided that this is a bug, as it does not correspond to the documentation. So I created a bug report under Windows.