/** * @test */ public function can_close_on_server_disconnect() { $container = ContainerImpl::getInstance($this->_properties); $server = $container->getBean('Server'); $server->open(); MyServerHandler::doClient($container->getBean('Client6')); $server->close(); $this->assertEquals(MyClientHandler666::$data, "disconnect"); }
public function handleData(\Ding\Helpers\Tcp\TcpPeer $peer) { $buffer = ''; $len = 1024; $peer->read($buffer, $len); self::$data = $buffer; }