C backend network receive buffer length command

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

C backend network receive buffer length command

Post by RichAlgeni »

For Windows code, we can currently use the following to get the number of bytes in the network receive buffer:

Code: Select all

socketHandle = ConnectionID(socketNumber)
result       = ioctlsocket_(socketHandle, #FIONREAD, @length)
Where length is a long, and contains the number we need.

Could we get a native PB6 command to do this instead? For example:

Code: Select all

bytesAvailable.l = AvailableNetworkData(Connection.l)