Skip to content
reduz edited this page Feb 23, 2014 · 9 revisions

StreamPeer

####Inherits: Reference ####Category: Core

Brief Description

Abstraction and base class for stream-based protocols.

Member Functions

Description

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.

Member Function Description

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.

Clone this wiki locally