Constants

SEPARATOR

SEPARATOR = ":" : string

Separator between service name and function name.

Should be the same as used at multiplexed Thrift server.

Properties

$trans_

$trans_ : \Thrift\Protocol\TTransport

Underlying transport

Type

\Thrift\Protocol\TTransport

$concreteProtocol_

$concreteProtocol_ : \Thrift\Protocol\TProtocol

Instance of protocol, to which all operations will be forwarded.

Type

\Thrift\Protocol\TProtocol

$serviceName_

$serviceName_ : string

The name of service.

Type

string

Methods

__construct()

__construct(\Thrift\Protocol\TProtocol  $protocol, string  $serviceName) 

Constructor of <code>TMultiplexedProtocol</code> class.

Wrap the specified protocol, allowing it to be used to communicate with a multiplexing server. The $serviceName is required as it is prepended to the message header so that the multiplexing server can broker the function call to the proper service.

Parameters

\Thrift\Protocol\TProtocol $protocol

All operations will be forward to this instance. Must be non-null.

string $serviceName

The name of service.

writeMessageBegin()

writeMessageBegin(string  $name, integer  $type, integer  $seqid) 

Writes the message header.

Prepends the service name to the function name, separated by TMultiplexedProtocol::SEPARATOR.

Parameters

string $name

Function name.

integer $type

Message type.

integer $seqid

The sequence id of this message.

writeMessageEnd()

writeMessageEnd() 

Close the message

writeStructBegin()

writeStructBegin(string  $name) : integer

Writes a struct header.

Parameters

string $name

Struct name

Throws

\Thrift\Protocol\TException

on write error

Returns

integer —

How many bytes written

writeStructEnd()

writeStructEnd() : integer

Close a struct.

Throws

\Thrift\Protocol\TException

on write error

Returns

integer —

How many bytes written

writeFieldBegin()

writeFieldBegin(  $fieldName,   $fieldType,   $fieldId) 

Parameters

$fieldName
$fieldType
$fieldId

writeFieldEnd()

writeFieldEnd() 

writeFieldStop()

writeFieldStop() 

writeMapBegin()

writeMapBegin(  $keyType,   $valType,   $size) 

Parameters

$keyType
$valType
$size

writeMapEnd()

writeMapEnd() 

writeListBegin()

writeListBegin(  $elemType,   $size) 

Parameters

$elemType
$size

writeListEnd()

writeListEnd() 

writeSetBegin()

writeSetBegin(  $elemType,   $size) 

Parameters

$elemType
$size

writeSetEnd()

writeSetEnd() 

writeBool()

writeBool(  $bool) 

Parameters

$bool

writeByte()

writeByte(  $byte) 

Parameters

$byte

writeI16()

writeI16(  $i16) 

Parameters

$i16

writeI32()

writeI32(  $i32) 

Parameters

$i32

writeI64()

writeI64(  $i64) 

Parameters

$i64

writeDouble()

writeDouble(  $dub) 

Parameters

$dub

writeString()

writeString(  $str) 

Parameters

$str

readMessageBegin()

readMessageBegin(string  $name, integer  $type,   $seqid) 

Reads the message header

Parameters

string $name

Function name

integer $type

message type TMessageType::CALL or TMessageType::REPLY

$seqid

readMessageEnd()

readMessageEnd() 

Read the close of message

readStructBegin()

readStructBegin(  $name) 

Parameters

$name

readStructEnd()

readStructEnd() 

readFieldBegin()

readFieldBegin(  $name,   $fieldType,   $fieldId) 

Parameters

$name
$fieldType
$fieldId

readFieldEnd()

readFieldEnd() 

readMapBegin()

readMapBegin(  $keyType,   $valType,   $size) 

Parameters

$keyType
$valType
$size

readMapEnd()

readMapEnd() 

readListBegin()

readListBegin(  $elemType,   $size) 

Parameters

$elemType
$size

readListEnd()

readListEnd() 

readSetBegin()

readSetBegin(  $elemType,   $size) 

Parameters

$elemType
$size

readSetEnd()

readSetEnd() 

readBool()

readBool(  $bool) 

Parameters

$bool

readByte()

readByte(  $byte) 

Parameters

$byte

readI16()

readI16(  $i16) 

Parameters

$i16

readI32()

readI32(  $i32) 

Parameters

$i32

readI64()

readI64(  $i64) 

Parameters

$i64

readDouble()

readDouble(  $dub) 

Parameters

$dub

readString()

readString(  $str) 

Parameters

$str

getTransport()

getTransport() : \Thrift\Protocol\TTransport

Accessor for transport

Returns

\Thrift\Protocol\TTransport

skip()

skip(\Thrift\Type\TType  $type) 

The skip function is a utility to parse over unrecognized date without causing corruption.

Parameters

\Thrift\Type\TType $type

What type is it

skipBinary()

skipBinary(\Thrift\Protocol\TTransport  $itrans, integer  $type) 

Utility for skipping binary data

Parameters

\Thrift\Protocol\TTransport $itrans

TTransport object

integer $type

Field type