[WAMP] Init Welcome message

This commit is contained in:
Chris Boden 2012-03-26 15:59:24 -04:00
parent 9ff2d406f0
commit 73b49b469d
2 changed files with 16 additions and 2 deletions
src/Ratchet/Component/WAMP

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

View File

@ -12,6 +12,7 @@ use Ratchet\Component\WAMP\Command\Action\Prefix;
* +--------------+----+------------------+
* | Message Type | ID | DIRECTION |
* |--------------+----+------------------+
* | WELCOME | 0 | Server-to-Client |
* | PREFIX | 1 | Bi-Directional |
* | CALL | 2 | Client-to-Server |
* | CALL RESULT | 3 | Server-to-Client |
@ -21,8 +22,8 @@ use Ratchet\Component\WAMP\Command\Action\Prefix;
* | PUBLISH | 7 | Client-to-Server |
* | EVENT | 8 | Server-to-Client |
* +--------------+----+------------------+
* @link http://www.tavendo.de/autobahn/protocol.html
* @link https://raw.github.com/oberstet/Autobahn/master/lib/javascript/autobahn.js
* @link http://wamp.ws/spec
* @link https://github.com/oberstet/AutobahnJS
*/
class WAMPServerComponent implements WebSocketComponentInterface {
const MSG_WELCOME = 0;