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
		
			
				
	
	
		
			37 lines
		
	
	
		
			652 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			37 lines
		
	
	
		
			652 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
namespace Ratchet\Application\WebSocket\Version;
 | 
						|
 | 
						|
/**
 | 
						|
 * @todo Consider making parent interface/composite for Message/Frame with (isCoalesced, getOpcdoe, getPayloadLength, getPayload)
 | 
						|
 */
 | 
						|
interface MessageInterface {
 | 
						|
    /**
 | 
						|
     * @alias getPayload
 | 
						|
     */
 | 
						|
    function __toString();
 | 
						|
 | 
						|
    /**
 | 
						|
     * @return bool
 | 
						|
     */
 | 
						|
    function isCoalesced();
 | 
						|
 | 
						|
    /**
 | 
						|
     * @param FragmentInterface
 | 
						|
     */
 | 
						|
    function addFrame(FrameInterface $fragment);
 | 
						|
 | 
						|
    /**
 | 
						|
     * @return int
 | 
						|
     */
 | 
						|
    function getOpcode();
 | 
						|
 | 
						|
    /**
 | 
						|
     * @return int
 | 
						|
     */
 | 
						|
    function getPayloadLength();
 | 
						|
 | 
						|
    /**
 | 
						|
     * @return string
 | 
						|
     */
 | 
						|
    function getPayload();
 | 
						|
} |