[WAMP] Init Welcome message
This commit is contained in:
		
							parent
							
								
									9ff2d406f0
								
							
						
					
					
						commit
						73b49b469d
					
				
							
								
								
									
										13
									
								
								src/Ratchet/Component/WAMP/Command/Action/Welcome.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								src/Ratchet/Component/WAMP/Command/Action/Welcome.php
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,13 @@ | |||||||
|  | <?php | ||||||
|  | namespace Ratchet\Component\WAMP\Command\Action; | ||||||
|  | use Ratchet\Resource\Command\Action\SendMessage; | ||||||
|  | use Ratchet\Component\WAMP\WAMPServerComponent as WAMP; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * @todo Needs work - sessionId needs to be stored w/ the Connection object | ||||||
|  |  */ | ||||||
|  | class CallResult extends SendMessage { | ||||||
|  |     public function setWelcome($sessionId, $serverIdent = '') { | ||||||
|  |         return $this->setMessage(json_encode(array(WAMP::MSG_WELCOME, $sessionId, 1, $serverIdent))); | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -12,6 +12,7 @@ use Ratchet\Component\WAMP\Command\Action\Prefix; | |||||||
|  * +--------------+----+------------------+ |  * +--------------+----+------------------+ | ||||||
|  * | Message Type | ID | DIRECTION        | |  * | Message Type | ID | DIRECTION        | | ||||||
|  * |--------------+----+------------------+ |  * |--------------+----+------------------+ | ||||||
|  |  * | WELCOME      | 0  | Server-to-Client | | ||||||
|  * | PREFIX       | 1  | Bi-Directional   | |  * | PREFIX       | 1  | Bi-Directional   | | ||||||
|  * | CALL         | 2  | Client-to-Server | |  * | CALL         | 2  | Client-to-Server | | ||||||
|  * | CALL RESULT  | 3  | Server-to-Client | |  * | CALL RESULT  | 3  | Server-to-Client | | ||||||
| @ -21,8 +22,8 @@ use Ratchet\Component\WAMP\Command\Action\Prefix; | |||||||
|  * | PUBLISH      | 7  | Client-to-Server | |  * | PUBLISH      | 7  | Client-to-Server | | ||||||
|  * | EVENT        | 8  | Server-to-Client | |  * | EVENT        | 8  | Server-to-Client | | ||||||
|  * +--------------+----+------------------+ |  * +--------------+----+------------------+ | ||||||
|  * @link http://www.tavendo.de/autobahn/protocol.html |  * @link http://wamp.ws/spec | ||||||
|  * @link https://raw.github.com/oberstet/Autobahn/master/lib/javascript/autobahn.js |  * @link https://github.com/oberstet/AutobahnJS | ||||||
|  */ |  */ | ||||||
| class WAMPServerComponent implements WebSocketComponentInterface { | class WAMPServerComponent implements WebSocketComponentInterface { | ||||||
|     const MSG_WELCOME     = 0; |     const MSG_WELCOME     = 0; | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Chris Boden
						Chris Boden