Checking socket stream data availability

BlitzMax Forums/BlitzMax Programming/Checking socket stream data availability

ozak(Posted 2005) [#1]
I can't seem to find a function for testing if there's data available on a stream. Can I use readavail() directly on the socket and then use the stream read functions?


Beaker(Posted 2005) [#2]
Try SocketReadAvail(sock)


marksibly(Posted 2005) [#3]
Hi,

Oops, looks like we're missing a 'SocketStreamSocket:TSocket()' function there - will fix.

In the meantime, there's an undocumented 'Socket()' method in SocketStream you can use, eg:

avail=SocketReadAvail( sockStream.Socket() )


ozak(Posted 2005) [#4]
Thanks. I know about the "hidden function", but it would be nice if you could check the stream like in Blitz3D/+ :)