WAMP FUNCTIONAL

RPC return message
RPC return error

WAMP protocol functionally complete!
This commit is contained in:
Chris Boden 2012-01-19 21:20:36 -05:00
parent f84be39fcf
commit 3372f72344
4 changed files with 62 additions and 0 deletions

View File

@ -127,6 +127,8 @@ class App implements WebSocketAppInterface {
}
/**
* If the developer's application as set some server-to-client prefixes to be set,
* this method ensures those are taxied to the next outgoing message
* @param Ratchet\Resource\Command\CommandInterface|NULL
* @return Ratchet\Resource\Command\Composite
*/

View File

@ -0,0 +1,31 @@
<?php
namespace Ratchet\Application\WAMP\Command\Action;
use Ratchet\Resource\Command\Action\SendMessage;
class CallError extends SendMessage {
protected $_id;
protected $_uri;
protected $_desc;
public function setError($callId, $uri, $desc) {
$this->_id = $callId;
$this->_uri = $uri;
$this->_desc = $desc;
return $this->setMessage(json_encode(array(4, $callId, $uri, $desc)));
}
public function getId() {
return $this->_id;
}
public function getUri() {
return $this->_uri;
}
public function getDescription() {
return $this->_desc;
}
}

View File

@ -0,0 +1,26 @@
<?php
namespace Ratchet\Application\WAMP\Command\Action;
use Ratchet\Resource\Command\Action\SendMessage;
/**
*/
class CallResult extends SendMessage {
protected $_id;
protected $_data;
public function setResult($callId, array $data = array()) {
$this->_id = $callId;
$this->_data = $data;
return $this->setMessage(json_encode(array(3, $callId, $data)));
}
public function getId() {
return $this->_id;
}
public function getData() {
return $this->_data;
}
}

View File

@ -3,6 +3,9 @@ namespace Ratchet\Application\WAMP\Command\Action;
use Ratchet\Resource\Command\Action\SendMessage;
/**
* Send a curie to uri mapping to the client
* Both sides will agree to send the curie, representing the uri,
* resulting in less data transfered
*/
class Prefix extends SendMessage {
protected $_curie;