diff --git a/src/Annotation/RpcProduct.php b/src/Annotation/RpcProduct.php new file mode 100644 index 0000000..e97cfb5 --- /dev/null +++ b/src/Annotation/RpcProduct.php @@ -0,0 +1,43 @@ +get($class); + + RpcManager::addCmdHandler($this->cmd, [$class, $method], $this->protocol); + + return parent::execute($class, $method); // TODO: Change the autogenerated stub + } + + +} diff --git a/src/Protocol.php b/src/Protocol.php new file mode 100644 index 0000000..0017460 --- /dev/null +++ b/src/Protocol.php @@ -0,0 +1,37 @@ +confirm($fd); } @@ -97,7 +86,17 @@ class Service implements OnClose, OnConnect, OnReceive, OnPacket, OnRequest */ public function onReceive(Server $server, int $fd, int $reactor_id, string $data): void { - // TODO: Implement onReceive() method. + try { + + // TODO: Implement onReceive() method. + [$cmd, [$body, $protocol]] = Protocol::parse($data); + } catch(\Throwable $throwable){ + + } + + + + }