SocketBytesAvailable

Family: Multiplayer · One form

What it does

SocketBytesAvailable reads from a Multiplayer object without changing it. It takes socketID (an integer), and answers an integer. socketID is the id of a Socket object, obtained elsewhere in the Multiplayer family.

Syntax

SocketBytesAvailable(socketID integer) → integer

Parameters

NameType
socketIDinteger

Every form returns

integer

Example · generated

socket = CreateSocketListener("value", 1)DO  Print(SocketBytesAvailable(socket))  Sync()LOOP

CreateSocketListener is there to give the call something to act on; SocketBytesAvailable is the line that matters. The DO … LOOP is not decoration: a classic BASIC program ends the moment it runs out of lines, and Sync() is what draws the frame.

91 commands in Multiplayer