-
Notifications
You must be signed in to change notification settings - Fork 0
class_streampeer
####Inherits: Reference ####Category: Core
Abstraction and base class for stream-based protocols.
- int put_data ( RawArray data )
- Array put_partial_data ( RawArray data )
- Array get_data ( int bytes )
- Array get_partial_data ( int bytes )
StreamPeer is an abstration and base class for stream-based protocols (such as TCP or Unix Sockets). It provides an API for sending and receiving data through streams as raw data or strings.
Send a chunk of data through the connection, blocking if necesary until the data is done sending. This function returns an [Error] code.
Send a chunk of data through the connection, if all the data could not be sent at once, only part of it will. This function returns two values, an [Error] code and an integer, describing how much data was actually sent.
Return a chunk data with the received bytes. The amount of bytes to be received can be requested in the "bytes" argument. If not enough bytes are available, the function will block until the desired amount is received. This function returns two values, an [Error] code and a data array.
Return a chunk data with the received bytes. The amount of bytes to be received can be requested in the "bytes" argument. If not enough bytes are available, the function will return how many were actually received. This function returns two values, an [Error] code, and a data array.