parent
f8098db6cc
commit
f22f209466
@ -79,8 +79,8 @@ class ServerProtocol implements MessageComponentInterface, WsServerInterface {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
* @throws \Exception
|
* @throws \Ratchet\Wamp\Exception
|
||||||
* @throws JsonException
|
* @throws \Ratchet\Wamp\JsonException
|
||||||
*/
|
*/
|
||||||
public function onMessage(ConnectionInterface $from, $msg) {
|
public function onMessage(ConnectionInterface $from, $msg) {
|
||||||
$from = $this->connections[$from];
|
$from = $this->connections[$from];
|
||||||
|
@ -39,9 +39,9 @@ class WampServer implements MessageComponentInterface, WsServerInterface {
|
|||||||
public function onMessage(ConnectionInterface $conn, $msg) {
|
public function onMessage(ConnectionInterface $conn, $msg) {
|
||||||
try {
|
try {
|
||||||
$this->wampProtocol->onMessage($conn, $msg);
|
$this->wampProtocol->onMessage($conn, $msg);
|
||||||
} catch (Exception $je) {
|
} catch (Exception $we) {
|
||||||
$conn->close(1007);
|
$conn->close(1007);
|
||||||
} catch (\UnexpectedValueException $uve) {
|
} catch (JsonException $je) {
|
||||||
$conn->close(1007);
|
$conn->close(1007);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -258,7 +258,7 @@ class ServerProtocolTest extends \PHPUnit_Framework_TestCase {
|
|||||||
* @dataProvider badFormatProvider
|
* @dataProvider badFormatProvider
|
||||||
*/
|
*/
|
||||||
public function testValidJsonButInvalidProtocol($message) {
|
public function testValidJsonButInvalidProtocol($message) {
|
||||||
$this->setExpectedException('\UnexpectedValueException');
|
$this->setExpectedException('\Ratchet\Wamp\Exception');
|
||||||
|
|
||||||
$conn = $this->newConn();
|
$conn = $this->newConn();
|
||||||
$this->_comp->onOpen($conn);
|
$this->_comp->onOpen($conn);
|
||||||
|
Loading…
Reference in New Issue
Block a user