Close connection and discard not sent data.
432130
public function close()
    {
        if ($this->closed)
        {
            return;
        }

        $this->emit('end', [ $this ]);
        $this->loop->removeStream($this->fd);
        $this->buffer->flushListeners();
        $this->flushListeners();
        unset($this->socket);
        $this->closed = true;
    }
1004466
def delete_connection(self, **kwargs):
        """"""
        conn = self.find_connection(**kwargs)
        if not conn:
            return False
        self.delete(conn)
        return True
54695
def disconnect(self):
        
        if self.con is not None:
            self.con.close()
            log.debug('Closed connection with with set-top box at %s:%s.',
                      self.ip, self.port)
452469
def close_connection(self):
        
        if self.port:
            self.port.close()
            self.logger.debug("Close TCP port")
1253209
def close_connection(self):  # pylint: disable=C0103
        
        if self.port:
            self.stop()
            self.logger.debug("Close port '%s'" % self.comport,
                              extra={'type': '<->'})
            self.port.close()
            self.port = False
1265492
async def clear(self):
        """"""
        async with self._cond:
            while self._free:
                conn = self._free.popleft()
                await conn.ensure_closed()
            self._cond.notify()
180256
def stop(self):
        """"""
        self.reconnect = False
        self.logger.debug("Shutting down.")
        if self.transport:
            self.transport.close()
265332
def close(self):
        """"""
        if self.connection:
            self.connection.close()
            self.connection = None
            logging.debug("Connection closed.")
651925
def disconnect(self):
        '''
        
        '''
        if not hasattr(self, '_sock'):
            return

        # TODO: If there are bytes left on the output, queue the close for
        # later.
        self._sock.close_cb = None
        self._sock.close()
985916
def _abort(self) -> None:
        """"""
        self.client_terminated = True
        self.server_terminated = True
        if self.stream is not None:
            self.stream.close()  # forcibly tear down the connection
        self.close()
648712
def close(self):
        """"""
        try:
            if self.connection is None:
                return
            while self.nextset():
                pass
        finally:
            self.connection = None
            self._result = None
993882
def Close(self):
		
		if self.connection is not None:
			try:
				self.connection.commit()
				self.connection.close()
				self.connection = None
			except Exception, e:
				pass
620122
def disconnect(self, receiver):
        """"""
        try:
            self.receivers.remove(receiver)
        except ValueError:
            raise ValueError('Unknown receiver: %s' % receiver)
1321752
def close(self):
        """"""
        self.log.warning('Closing connection to AVR')
        self._closing = True
        if self.protocol.transport:
            self.protocol.transport.close()
877323
def stop(self):
        """"""
        with self.lock:
            self._message_received(ConnectionClosed(self._file, self))
717732
def close(self):
        ''''''
        if self.writer:
            _logger.debug('Closing connection.')
            self.writer.close()

            self.writer = None
            self.reader = None

        if self._close_timer:
            self._close_timer.close()

        self._state = ConnectionState.dead
317289
def close(self):
        '''
        
        '''
        if self._wrapped_connection and self._pool:
            logger.debug("Returning connection %s to pool %s" % (self._wrapped_connection, self._pool))
            self._pool.putconn(self._wrapped_connection)
            self._wrapped_connection = None