public function testConnectionDoesEndWhenClientCloses()
{
$client = stream_socket_client('tcp://localhost:' . $this->port);
fclose($client);
$mock = $this->expectCallableOnce();
$this->server->on('connection', function ($conn) use($mock) {
$conn->on('end', $mock);
});
$this->loop->tick();
$this->loop->tick();
}