\Thrift\ServerTForkingServer

A forking implementation of a Thrift server.

Summary

Methods
Properties
Constants
__construct()
serve()
stop()
No public properties found
No constants found
No protected methods found
$processor_
$transport_
$inputTransportFactory_
$outputTransportFactory_
$inputProtocolFactory_
$outputProtocolFactory_
$children_
N/A
handleParent()
handleChild()
collectChildren()
$stop_
N/A

Properties

$processor_

$processor_ : \Thrift\Server\TProcessor

Processor to handle new clients

Type

\Thrift\Server\TProcessor

$transport_

$transport_ : \Thrift\Server\TServerTransport

Server transport to be used for listening and accepting new clients

Type

\Thrift\Server\TServerTransport

$children_

$children_ : array

List of children.

Type

array

$stop_

$stop_ : boolean

Flag for the main serving loop

Type

boolean

Methods

__construct()

__construct(object  $processor, \Thrift\Server\TServerTransport  $transport, \Thrift\Factory\TTransportFactory  $inputTransportFactory, \Thrift\Factory\TTransportFactory  $outputTransportFactory, \Thrift\Factory\TProtocolFactory  $inputProtocolFactory, \Thrift\Factory\TProtocolFactory  $outputProtocolFactory) : void

Sets up all the factories, etc

Parameters

object $processor
\Thrift\Server\TServerTransport $transport
\Thrift\Factory\TTransportFactory $inputTransportFactory
\Thrift\Factory\TTransportFactory $outputTransportFactory
\Thrift\Factory\TProtocolFactory $inputProtocolFactory
\Thrift\Factory\TProtocolFactory $outputProtocolFactory

serve()

serve() : void

Listens for new client using the supplied transport. We fork when a new connection arrives.

stop()

stop() : void

Stops the server running. Kills the transport and then stops the main serving loop

handleParent()

handleParent(\Thrift\Transport\TTransport  $transport, integer  $pid) : void

Code run by the parent

Parameters

\Thrift\Transport\TTransport $transport
integer $pid

handleChild()

handleChild(\Thrift\Transport\TTransport  $transport) : void

Code run by the child.

Parameters

\Thrift\Transport\TTransport $transport

collectChildren()

collectChildren() : void

Collects any children we may have