Private
Public Access
1
0

working websocket client and server w/o session handling and storage

This commit is contained in:
2016-10-18 15:58:53 +02:00
parent 8578a94caf
commit fbfbe5a13b
9 changed files with 229 additions and 15 deletions

View File

@@ -0,0 +1,35 @@
<?php
namespace Mine\SeekerBundle\Rpc;
use Ratchet\ConnectionInterface;
use Gos\Bundle\WebSocketBundle\RPC\RpcInterface;
use Gos\Bundle\WebSocketBundle\Router\WampRequest;
class AcmeRpc implements RpcInterface
{
/**
* Adds the params together
*
* Note: $conn isnt used here, but contains the connection of the person making this request.
*
* @param ConnectionInterface $connection
* @param WampRequest $request
* @param array $params
* @return array
*/
public function addFunc(ConnectionInterface $connection, WampRequest $request, $params)
{
return array("result" => array_sum($params));
}
/**
* Name of RPC, use for pubsub router (see step3)
*
* @return string
*/
public function getName()
{
return 'acme.rpc';
}
}