diff options
Diffstat (limited to 'plugins/app/tests/tcp.php')
-rw-r--r-- | plugins/app/tests/tcp.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/plugins/app/tests/tcp.php b/plugins/app/tests/tcp.php new file mode 100644 index 00000000..2d6fb00a --- /dev/null +++ b/plugins/app/tests/tcp.php @@ -0,0 +1,20 @@ +<?php +/** + * @var Goridge\RelayInterface $relay + */ + +use Spiral\Goridge; +use Spiral\RoadRunner; + +require dirname(__DIR__) . "/../../vendor_php/autoload.php"; + +$relay = new Goridge\SocketRelay("localhost", 9999); +$rr = new RoadRunner\Worker($relay); + +while ($in = $rr->receive($ctx)) { + try { + $rr->send((string)$in); + } catch (\Throwable $e) { + $rr->error((string)$e); + } +}
\ No newline at end of file |