ReceiveNetworkData() returns -1, should be 0

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
RichAlgeni
Addict
Addict
Posts: 935
Joined: Wed Sep 22, 2010 1:50 am
Location: Bradenton, FL

ReceiveNetworkData() returns -1, should be 0

Post 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
Warmonger
Enthusiast
Enthusiast
Posts: 156
Joined: Wed Apr 20, 2011 4:24 pm

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

Post 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.
Its Not A Bug, Its An Undocumented Feature!
Relax Its All Just Ones And Zeros
There Is No Place Like 127.0.0.1 Except ::1
I do things TO my computer, not WITH my computer... I am a nerd.
User avatar
RichAlgeni
Addict
Addict
Posts: 935
Joined: Wed Sep 22, 2010 1:50 am
Location: Bradenton, FL

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

Post 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.
Post Reply