Overview

Packages

  • None
  • thrift
    • transport

Classes

  • TBufferedTransport
  • TFramedTransport
  • THttpClient
  • TMemoryBuffer
  • TNullTransport
  • TPhpStream
  • TSocket
  • TSocketPool
  • TTransport
  • Overview
  • Package
  • Class
  • Tree

Class TFramedTransport

Framed transport. Writes and reads data in chunks that are stamped with their length.

TTransport
Extended by TFramedTransport
Package: thrift\transport
Author: Mark Slee mcslee@facebook.com
Located at Horde/Thrift/thrift_root/transport/TFramedTransport.php
Methods summary
public
# __construct( TTransport $transport = null, mixed $read = true, mixed $write = true )

Constructor.

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

TTransportException
if cannot open
public
# close( )

Close the transport.

Close the transport.

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

$len
How much data

Returns

string
The data that has been read

Throws

TTransportException
if cannot read any more data
public
# putBack( string $data )

Put previously read data back into the buffer

Put previously read data back into the buffer

Parameters

$data
data to return
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

TTransportException
if writing fails
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

TTransportException
if a writing error occurs

Overrides

TTransport::flush()
Methods inherited from TTransport
readAll()
API documentation generated by ApiGen