Page 1 of 1

#PB_Network_WouldBlock

Posted: Mon Nov 02, 2009 9:52 pm
by HeX0R
If you want to do serious network tools, you will come very early to the conclusion, that you will need at least the WSAGetLastError_()-Api (now speaking for Windows).
If you send Files or other big, nasty things through your LAN, you will recognize a result of -1 of SendNetworkData() really often.
With pure purebasic, you don't have any idea, if now the others side buffer is full (#WSAEWOULDBLOCK) or has died.

At least one more possible Return-Value for SendNetworkData() would help a lot.
For example -1 = Something went really wrong; -2 = Buffer full, try again later...

Re: #PB_Network_WouldBlock

Posted: Sat Nov 07, 2009 10:29 am
by Tranquil
That is what I try to pray since years in nearly any network related thread. 99.9% of the network codes posted on this forum do NOT check for a WSAError (-1) on SendNetworkData() or ReceiveNetworkData(). Most users expect that the complete memory has been send or will be received on one entire call of this commands. But thats often not the truth.

Even the PB Documentation does not give a hint on how to correctly use this commands. And if I take a look on the examples provided with PB... horrible!

Re: #PB_Network_WouldBlock

Posted: Sat Nov 07, 2009 5:35 pm
by moogle
Shouldn't really rely on PB's network commands I suppose. There's been alot of network feature requests long time ago (by shannara and others I'm sure) but we never get it :(