PHP Class Thruway\Transport\RatchetTransport

Inheritance: implements Thruway\Transport\TransportInterface
显示文件 Open project: voryx/thruway Class Usage Examples

Public Methods

Method Description
__construct ( Ratchet\ConnectionInterface $conn, React\EventLoop\LoopInterface $loop ) Constructor
close ( ) Close transport
getTransportDetails ( ) : array Get transport details
onPong ( Ratchet\WebSocket\Version\RFC6455\Frame $frame ) Handle on pong
ping ( integer $timeout = 10 ) : Promise Ping
sendMessage ( Thruway\Message\Message $msg ) Send message

Method Details

__construct() public method

Constructor
public __construct ( Ratchet\ConnectionInterface $conn, React\EventLoop\LoopInterface $loop )
$conn Ratchet\ConnectionInterface
$loop React\EventLoop\LoopInterface

close() public method

Close transport
public close ( )

getTransportDetails() public method

Get transport details
public getTransportDetails ( ) : array
return array

onPong() public method

Handle on pong
public onPong ( Ratchet\WebSocket\Version\RFC6455\Frame $frame )
$frame Ratchet\WebSocket\Version\RFC6455\Frame

ping() public method

Ping
public ping ( integer $timeout = 10 ) : Promise
$timeout integer
return React\Promise\Promise

sendMessage() public method

Send message
public sendMessage ( Thruway\Message\Message $msg )
$msg Thruway\Message\Message