mxmbsocket/lib/Ratchet/Application/WebSocket/Version/VersionInterface.php
Chris Boden 5653f01f2f Message buffering & Refactoring
Refactored unframe() methods into Message/Frame classes (per protocol version)
Change onRecv of WebSocket App to use new interfaces to test statuses, resulting in reuniting a message fragmented by TCP
Wrote unit test covering most of new HyBi10 Frame class
2011-11-18 16:37:32 -05:00

40 lines
920 B
PHP

<?php
namespace Ratchet\Application\WebSocket\Version;
/**
* Despite the version iterations of WebInterface the actions they go through are similar
* This standardizes how the server handles communication with each protocol version
*/
interface VersionInterface {
/**
* Perform the handshake and return the response headers
* @param string
* @return array|string
*/
function handshake($message);
/**
* @return MessageInterface
*/
function newMessage();
/**
* @return FrameInterface
*/
function newFrame();
/**
* Get a framed message as per the protocol and return the decoded message
* @param string
* @return string
* @todo Return a frame object with message, type, masked?
* @deprecated
*/
function unframe($message);
/**
* @param string
* @return string
*/
function frame($message);
}