Class TFramedTransport
Framed transport. Writes and reads data in chunks that are stamped with
their length.
-
TTransport
-
TFramedTransport
Methods summary
public
|
#
__construct( TTransport $transport = null, mixed $read = true, mixed $write = true )
Constructor.
Parameters
- $transport
- Underlying transport
- $read
-
- $write
-
|
public
boolean
|
#
isOpen( )
Whether this transport is open.
Whether this transport is open.
Returns
boolean true if open
|
public
|
#
open( )
Open the transport for reading/writing
Open the transport for reading/writing
Throws
|
public
|
|
public
string
|
#
read( integer $len )
Reads from the buffer. When more data is required reads another entire
chunk and serves future reads out of that.
Reads from the buffer. When more data is required reads another entire
chunk and serves future reads out of that.
Parameters
Returns
string The data that has been read
Throws
|
public
|
#
putBack( string $data )
Put previously read data back into the buffer
Put previously read data back into the buffer
Parameters
|
public
|
#
write( string $buf, integer $len = null )
Writes some data to the pending output buffer.
Writes some data to the pending output buffer.
Parameters
- $buf
- The data
- $len
- Limit of bytes to write
Throws
|
public
|
#
flush( )
Writes the output buffer to the stream in the format of a 4-byte length
followed by the actual data.
Writes the output buffer to the stream in the format of a 4-byte length
followed by the actual data.
Throws
Overrides
|