PHP Class Ratchet\WebSocket\Version\RFC6455

Inheritance: implements Ratchet\WebSocket\Version\VersionInterface
显示文件 Open project: cboden/ratchet Class Usage Examples

Protected Properties

Property Type Description
$_verifier Ratchet\WebSocket\Version\RFC6455\HandshakeVerifier
$validator Ratchet\WebSocket\Encoding\ValidatorInterface

Public Methods

Method Description
__construct ( Ratchet\WebSocket\Encoding\ValidatorInterface $validator = null )
getVersionNumber ( )
handshake ( Guzzle\Http\Message\RequestInterface $request )
isProtocol ( Guzzle\Http\Message\RequestInterface $request )
isValidCloseCode ( $val ) : boolean Determine if a close code is valid
newFrame ( string | null $payload = null, boolean | null $final = null, integer | null $opcode = null ) : Ratchet\WebSocket\Version\RFC6455\Frame
newMessage ( ) : Ratchet\WebSocket\Version\RFC6455\Message
onMessage ( Ratchet\ConnectionInterface $from, string $data )
sign ( string $key ) : string Used when doing the handshake to encode the key, verifying client/server are speaking the same language
upgradeConnection ( Ratchet\ConnectionInterface $conn, Ratchet\MessageInterface $coalescedCallback ) : Ratchet\WebSocket\Version\RFC6455\Connection

Protected Methods

Method Description
setCloseCodes ( ) Creates a private lookup of valid, private close codes

Method Details

__construct() public method

public __construct ( Ratchet\WebSocket\Encoding\ValidatorInterface $validator = null )
$validator Ratchet\WebSocket\Encoding\ValidatorInterface

getVersionNumber() public method

public getVersionNumber ( )

handshake() public method

public handshake ( Guzzle\Http\Message\RequestInterface $request )
$request Guzzle\Http\Message\RequestInterface

isProtocol() public method

public isProtocol ( Guzzle\Http\Message\RequestInterface $request )
$request Guzzle\Http\Message\RequestInterface

isValidCloseCode() public method

Determine if a close code is valid
public isValidCloseCode ( $val ) : boolean
return boolean

newFrame() public method

public newFrame ( string | null $payload = null, boolean | null $final = null, integer | null $opcode = null ) : Ratchet\WebSocket\Version\RFC6455\Frame
$payload string | null
$final boolean | null
$opcode integer | null
return Ratchet\WebSocket\Version\RFC6455\Frame

newMessage() public method

public newMessage ( ) : Ratchet\WebSocket\Version\RFC6455\Message
return Ratchet\WebSocket\Version\RFC6455\Message

onMessage() public method

public onMessage ( Ratchet\ConnectionInterface $from, string $data )
$from Ratchet\ConnectionInterface
$data string

setCloseCodes() protected method

Creates a private lookup of valid, private close codes
protected setCloseCodes ( )

sign() public method

Used when doing the handshake to encode the key, verifying client/server are speaking the same language
public sign ( string $key ) : string
$key string
return string

upgradeConnection() public method

public upgradeConnection ( Ratchet\ConnectionInterface $conn, Ratchet\MessageInterface $coalescedCallback ) : Ratchet\WebSocket\Version\RFC6455\Connection
$conn Ratchet\ConnectionInterface
$coalescedCallback Ratchet\MessageInterface
return Ratchet\WebSocket\Version\RFC6455\Connection

Property Details

$_verifier protected_oe property

protected HandshakeVerifier,Ratchet\WebSocket\Version\RFC6455 $_verifier
return Ratchet\WebSocket\Version\RFC6455\HandshakeVerifier

$validator protected_oe property

protected ValidatorInterface,Ratchet\WebSocket\Encoding $validator
return Ratchet\WebSocket\Encoding\ValidatorInterface