/**
  * Configures an established stream for a given connection.
  *
  * @param \React\Stream\DuplexStreamInterface $stream
  * @param \Phergie\Irc\ConnectionInterface $connection
  */
 protected function initializeStream(DuplexStreamInterface $stream, ConnectionInterface $connection)
 {
     try {
         $connection->setData('stream', $stream);
         $write = $this->getWriteStream($connection);
         $connection->setData('write', $write);
         $this->configureStreams($connection, $stream, $write);
         $this->identifyUser($connection, $write);
     } catch (\Exception $e) {
         $this->emitConnectionError($e, $connection);
     }
 }