[WAMP] Store sessionId in Connection

This commit is contained in:
Chris Boden 2012-04-26 20:01:12 -04:00
parent 56768b5963
commit c2642e1c74

View File

@ -77,6 +77,7 @@ class WAMPServerComponent implements WebSocketComponentInterface {
*/ */
public function onOpen(ConnectionInterface $conn) { public function onOpen(ConnectionInterface $conn) {
$conn->WAMP = new \StdClass; $conn->WAMP = new \StdClass;
$conn->WAMP->sessionId = uniqid();
$conn->WAMP->prefixes = array(); $conn->WAMP->prefixes = array();
$conn->WAMP->subscriptions = array(); $conn->WAMP->subscriptions = array();
@ -86,7 +87,7 @@ class WAMPServerComponent implements WebSocketComponentInterface {
}; };
$welcome = new Welcome($conn); $welcome = new Welcome($conn);
$welcome->setWelcome(uniqid(), 'Ratchet/0.1'); $welcome->setWelcome($conn->WAMP->sessionId, 'Ratchet/0.1');
$this->_msg_buffer->enqueue($welcome); $this->_msg_buffer->enqueue($welcome);
return $this->attachStack($this->_decorating->onOpen($conn)); return $this->attachStack($this->_decorating->onOpen($conn));