PHP Class Thruway\Peer\Client

Inheritance: extends Thruway\Peer\AbstractPeer, implements Evenement\EventEmitterInterface, use trait Evenement\EventEmitterTrait
Show file Open project: voryx/thruway Class Usage Examples

Protected Properties

Property Type Description
$session Thruway\ClientSession

Public Methods

Method Description
__construct ( string $realm, React\EventLoop\LoopInterface $loop = null ) Constructor
__toString ( ) : string
addClientAuthenticator ( Thruway\Authentication\ClientAuthenticationInterface $ca ) Add client authenticator
addRole ( AbstractRole $role ) : Client Add role
addTransportProvider ( Thruway\Transport\ClientTransportProviderInterface $transportProvider ) Add transport provider
getAuthId ( ) : string Get authenticate ID
getAuthMethods ( ) : array Get list authenticate methods
getCallee ( ) : Callee Get callee
getCaller ( ) : Caller Get caller
getLoop ( ) : React\EventLoop\LoopInterface Get loop
getPublisher ( ) : Publisher Get publisher
getRealm ( ) : string
getRoleInfoObject ( ) : object
getRoles ( ) : array Get list roles
getSession ( ) : ClientSession Get client session
getSubscriber ( ) : Subscriber Get subscriber
onClose ( mixed $reason ) Handle close session
onMessage ( Thruway\Transport\TransportInterface $transport, Thruway\Message\Message $msg ) Handle process message
onOpen ( Thruway\Transport\TransportInterface $transport ) Handle open transport
onSessionEnd ( ClientSession $session ) Handle end session
onSessionStart ( ClientSession $session, Thruway\Transport\TransportInterface $transport ) This is meant to be overridden so that the client can do its thing
processAbort ( ClientSession $session, Thruway\Message\AbortMessage $msg )
processChallenge ( ClientSession $session, Thruway\Message\ChallengeMessage $msg ) Handle process challenge message
processGoodbye ( ClientSession $session, Thruway\Message\GoodbyeMessage $msg ) Handle process goodbye message
processOther ( ClientSession $session, Thruway\Message\Message $msg ) Handle process other Message
processWelcome ( ClientSession $session, Thruway\Message\WelcomeMessage $msg ) Process Welcome message
retryConnection ( ) Retry connecting to the transport
setAttemptRetry ( boolean $attemptRetry ) Set attempt retry
setAuthId ( string $authId ) Set authenticate ID
setAuthMethods ( array $authMethods ) Set list authenticate methods
setLoop ( React\EventLoop\LoopInterface $loop )
setReconnectOptions ( array $reconnectOptions ) Set reconnect options
start ( boolean $startLoop = true ) Start the transport
startSession ( ClientSession $session ) Start client session

Method Details

__construct() public method

Constructor
public __construct ( string $realm, React\EventLoop\LoopInterface $loop = null )
$realm string
$loop React\EventLoop\LoopInterface

__toString() public method

public __toString ( ) : string
return string

addClientAuthenticator() public method

Add client authenticator
public addClientAuthenticator ( Thruway\Authentication\ClientAuthenticationInterface $ca )
$ca Thruway\Authentication\ClientAuthenticationInterface

addRole() public method

Add role
public addRole ( AbstractRole $role ) : Client
$role Thruway\Role\AbstractRole
return Client

addTransportProvider() public method

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

getAuthId() public method

Get authenticate ID
public getAuthId ( ) : string
return string

getAuthMethods() public method

Get list authenticate methods
public getAuthMethods ( ) : array
return array

getCallee() public method

Get callee
public getCallee ( ) : Callee
return Thruway\Role\Callee

getCaller() public method

Get caller
public getCaller ( ) : Caller
return Thruway\Role\Caller

getLoop() public method

Get loop
public getLoop ( ) : React\EventLoop\LoopInterface
return React\EventLoop\LoopInterface

getPublisher() public method

Get publisher
public getPublisher ( ) : Publisher
return Thruway\Role\Publisher

getRealm() public method

public getRealm ( ) : string
return string

getRoleInfoObject() public method

public getRoleInfoObject ( ) : object
return object

getRoles() public method

Get list roles
public getRoles ( ) : array
return array

getSession() public method

Get client session
public getSession ( ) : ClientSession
return Thruway\ClientSession

getSubscriber() public method

Get subscriber
public getSubscriber ( ) : Subscriber
return Thruway\Role\Subscriber

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 )
$transport Thruway\Transport\TransportInterface
$msg Thruway\Message\Message

onOpen() public method

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

onSessionEnd() public method

Handle end session
public onSessionEnd ( ClientSession $session )
$session Thruway\ClientSession

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

processAbort() public method

public processAbort ( ClientSession $session, Thruway\Message\AbortMessage $msg )
$session Thruway\ClientSession
$msg Thruway\Message\AbortMessage

processChallenge() public method

Handle process challenge message
public processChallenge ( ClientSession $session, Thruway\Message\ChallengeMessage $msg )
$session Thruway\ClientSession
$msg Thruway\Message\ChallengeMessage

processGoodbye() public method

Handle process goodbye message
public processGoodbye ( ClientSession $session, Thruway\Message\GoodbyeMessage $msg )
$session Thruway\ClientSession
$msg Thruway\Message\GoodbyeMessage

processOther() public method

Handle process other Message
public processOther ( ClientSession $session, Thruway\Message\Message $msg )
$session Thruway\ClientSession
$msg Thruway\Message\Message

processWelcome() public method

Process Welcome message
public processWelcome ( ClientSession $session, Thruway\Message\WelcomeMessage $msg )
$session Thruway\ClientSession
$msg Thruway\Message\WelcomeMessage

retryConnection() public method

Retry connecting to the transport
public retryConnection ( )

setAttemptRetry() public method

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

setAuthId() public method

Set authenticate ID
public setAuthId ( string $authId )
$authId string

setAuthMethods() public method

Set list authenticate methods
public setAuthMethods ( array $authMethods )
$authMethods array

setLoop() public method

public setLoop ( React\EventLoop\LoopInterface $loop )
$loop React\EventLoop\LoopInterface

setReconnectOptions() public method

Set reconnect options
public setReconnectOptions ( array $reconnectOptions )
$reconnectOptions array

start() public method

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

startSession() public method

Start client session
public startSession ( ClientSession $session )
$session Thruway\ClientSession

Property Details

$session protected property

protected ClientSession,Thruway $session
return Thruway\ClientSession