Request a connection close from the SMTP session handling instance.
760402
def close_connection(self):
        ""
        if self._is_connected:
            self._is_connected = False
            self._command_parser.close_when_done()
1176617
def close(self):
        """"""
        # Instead of actually closing the connection,
        # return it to the pool so it can be reused.
        if self._con is not None:
            self._pool.returnConnection(self._con)
            self._con = None
494931
def on_close(self):
        '''
        
        '''

        if self.id in self.funcserver.websocks:
            self.funcserver.websocks[self.id] = None
            ioloop = tornado.ioloop.IOLoop.instance()
            ioloop.add_callback(lambda: self.funcserver.websocks.pop(self.id, None))

        psession = self.funcserver.pysessions.get(self.pysession_id, None)
        if psession:
            psession['socks'].remove(self.id)
            if not psession['socks']:
                del self.funcserver.pysessions[self.pysession_id]
834609
def DropConnection(self, connection):
    """"""
    try:
      connection.cursor.close()
    except MySQLdb.Error:
      pass

    try:
      connection.dbh.close()
    except MySQLdb.Error:
      pass
1250134
def close(self, code=3000, message='Go away!'):
        
        if self.state != CLOSED:
            try:
                self.conn.on_close()
            except:
                LOG.debug("Failed to call on_close().", exc_info=True)
            finally:
                self.state = CLOSED
                self.close_reason = (code, message)
                self.conn = None

            # Bump stats
            self.stats.on_sess_closed(self.transport_name)

            # If we have active handler, notify that session was closed
            if self.handler is not None:
                self.handler.session_closed()
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
503722
def requests_request(method, url, **kwargs):
    """"""
    session = local_sessions.session
    response = session.request(method=method, url=url, **kwargs)
    session.close()
    return response
513188
public function Close()
    {
        $this->error     = null; // so there is no confusion
        $this->helo_rply = null;
        if (!empty($this->smtp_conn)) {
            // close the connection and cleanup
            fclose($this->smtp_conn);
            $this->smtp_conn = 0;
        }
    }
1035064
def close(self):
        """"""
        # Instead of actually closing the connection,
        # return it to the pool so it can be reused.
        if self._con is not None:
            self._pool.cache(self._con)
            self._con = None
452469
def close_connection(self):
        
        if self.port:
            self.port.close()
            self.logger.debug("Close TCP port")
1061702
def closeConnection(self):
        """"""
        print '%s call closeConnection' % self.port
        try:
            if self.handle:
                self.handle.close()
                self.handle = None
        except Exception, e:
            ModuleHelper.WriteIntoDebugLogger("closeConnection() Error: " + str(e))
1285464
def close(self, code=3000, message='Go away!'):
        
        if self.state != SESSION_STATE.CLOSED:
            try:
                self.conn.connectionLost()
            except Exception as e:
                log.msg("Failed to call connectionLost(): %r." % e)
            finally:
                self.state = SESSION_STATE.CLOSED
                self.close_reason = (code, message)

            # Bump stats
            self.stats.sessionClosed(self.transport_name)

            # If we have active handler, notify that session was closed
            if self.handler is not None:
                self.handler.session_closed()
629251
def close(self):
        """"""
        try:
            try:
                self.connection.quit()
            except socket.sslerror:
                # This happens when calling quit() on a TLS connection
                # sometimes.
                self.connection.close()
            except Exception as e:
                logger.error(
                    "Error trying to close connection to server " "%s:%s: %s",
                    self.host,
                    self.port,
                    e,
                )
                if self.fail_silently:
                    return
                raise
        finally:
            self.connection = None
854052
async def ensure_closed(self):
        """"""
        if self._writer is None:
            # connection has been closed
            return
        send_data = struct.pack('<i', 1) + int2byte(COMMAND.COM_QUIT)
        self._writer.write(send_data)
        await self._writer.drain()
        self.close()
9121
def closed(self, reason):
        """"""
        self.client.remove_connection(self)
        self.protocol.connection_lost(reason)
        if not isinstance(reason, ConnectionClosed):
            logger.warn("connection closed, reason {}".format(reason))
        else:
            logger.info("connection closed")
391762
def close(self):
        """"""
        if isinstance(self._session, requests.Session):
            self._session.close()
251141
def shutdown_request(self, request):
        """"""
        try:
            # explicitly shutdown.  socket.close() merely releases
            # the socket and waits for GC to perform the actual close.
            request.shutdown(socket.SHUT_RDWR)

        except:
            pass  # some platforms may raise ENOTCONN here
        self.close_request(request)