Messaging Interfaces
Added Messaging and Framing Interfaces
This commit is contained in:
parent
021a185753
commit
118923e784
55
lib/Ratchet/Protocol/WebSocket/FrameInterface.php
Normal file
55
lib/Ratchet/Protocol/WebSocket/FrameInterface.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
namespace Ratchet\Protocol\WebSocket;
|
||||
|
||||
interface FrameInterface {
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
function isCoalesced();
|
||||
|
||||
/**
|
||||
* @param string
|
||||
*/
|
||||
function addBuffer($buf);
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
function isFragment();
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
function isFinial();
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
function isMasked();
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
function getOpcode();
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
function getPayloadLength();
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
function getReceivedPayloadLength();
|
||||
|
||||
/**
|
||||
* 32-big string
|
||||
* @return string
|
||||
*/
|
||||
function getMaskingKey();
|
||||
|
||||
/**
|
||||
* @param string
|
||||
*/
|
||||
function getPayload();
|
||||
}
|
32
lib/Ratchet/Protocol/WebSocket/MessageInterface.php
Normal file
32
lib/Ratchet/Protocol/WebSocket/MessageInterface.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
namespace Ratchet\Protocol\WebSocket;
|
||||
|
||||
/**
|
||||
* @todo Consider making parent interface/composite for Message/Frame with (isCoalesced, getOpcdoe, getPayloadLength, getPayload)
|
||||
*/
|
||||
interface MessageInterface {
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
function isCoalesced();
|
||||
|
||||
/**
|
||||
* @param FragmentInterface
|
||||
*/
|
||||
function addFragment(FragmentInterface $fragment);
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
function getOpcode();
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
function getPayloadLength();
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
function getPayload();
|
||||
}
|
Loading…
Reference in New Issue
Block a user