Messaging Interfaces

Added Messaging and Framing Interfaces
This commit is contained in:
Chris Boden 2011-11-12 13:50:30 -05:00
parent 021a185753
commit 118923e784
2 changed files with 87 additions and 0 deletions

View 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();
}

View 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();
}