Socket.getPendingReadSize

From Spheriki

Jump to: navigation, search

Returns the size of the next block of data to be read from the socket.


Contents

Usage

number Socket.getPendingReadSize();
  • Socket Sphere Socket object. The socket to obtain the next data read size from.
  • number is returned, representing the size of the Sphere ByteArray to be returned by a subsequent Socket.read() call.


Examples

See example for OpenAddress(), near the third step ("// 3. If connected, send and receieve data.").


Notes

  • This function is primarily used before or in a call to Socket.read(), where the value returned by this function can be used as the argument provided to Socket.read().
  • When Socket.read() is called, the size of the ByteArray it returns will be the same as the value returned by this function.


See also

Personal tools