protected function getEndCallback(ReadStream $read, WriteStream $write, ConnectionInterface $connection, TimerInterface $timer)
    {
        $logger = $this->getLogger();
        return function() use ($read, $write, $connection, $timer, $logger) {
            $this->removeActiveConnection($connection);
            $this->emit('connect.end', array($connection, $logger));
            $this->cancelTimer($timer);
            $connection->clearData();
            $read->close();
            $write->close();
        };
    }