PHP Interface Thruway\Peer\ClientInterface

Inheritance: extends Thruway\Peer\PeerInterface
Datei anzeigen Open project: voryx/thruway Interface Usage Examples

Public Methods

Method Description
addTransportProvider ( Thruway\Transport\ClientTransportProviderInterface $transportProvider ) Add transport provider
onClose ( mixed $reason ) Handle close session
onMessage ( Thruway\Transport\TransportInterface $transport, Thruway\Message\Message $msg ) : mixed Handle process message
onOpen ( Thruway\Transport\TransportInterface $transport ) Handle open transport
onSessionStart ( ClientSession $session, Thruway\Transport\TransportInterface $transport ) This is meant to be overridden so that the client can do its thing
setAttemptRetry ( boolean $attemptRetry ) Set attempt retry
start ( boolean $startLoop = true ) Start the transport

Method Details

addTransportProvider() public method

Add transport provider
public addTransportProvider ( Thruway\Transport\ClientTransportProviderInterface $transportProvider )
$transportProvider Thruway\Transport\ClientTransportProviderInterface

onClose() public method

Handle close session
public onClose ( mixed $reason )
$reason mixed

onMessage() public method

Handle process message
public onMessage ( Thruway\Transport\TransportInterface $transport, Thruway\Message\Message $msg ) : mixed
$transport Thruway\Transport\TransportInterface
$msg Thruway\Message\Message
return mixed

onOpen() public method

Handle open transport
public onOpen ( Thruway\Transport\TransportInterface $transport )
$transport Thruway\Transport\TransportInterface

onSessionStart() public method

This is meant to be overridden so that the client can do its thing
public onSessionStart ( ClientSession $session, Thruway\Transport\TransportInterface $transport )
$session Thruway\ClientSession
$transport Thruway\Transport\TransportInterface

setAttemptRetry() public method

Set attempt retry
public setAttemptRetry ( boolean $attemptRetry )
$attemptRetry boolean

start() public method

Start the transport
public start ( boolean $startLoop = true )
$startLoop boolean