[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 |
|
||||
* |--------------+----+------------------+
|
||||
* | 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;
|
||||
|
Loading…
Reference in New Issue
Block a user