#PB_Network_WouldBlock

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
HeX0R
Addict
Addict
Posts: 1189
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

#PB_Network_WouldBlock

Post 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...
Tranquil
Addict
Addict
Posts: 952
Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe

Re: #PB_Network_WouldBlock

Post 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!
Tranquil
moogle
Enthusiast
Enthusiast
Posts: 372
Joined: Tue Feb 14, 2006 9:27 pm
Location: London, UK

Re: #PB_Network_WouldBlock

Post 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 :(
Image
Post Reply