Remote server close connection
977449
function TcpClientError (err) {
    var svcopts   = this.svcopts;  // make objec info visible inside timer handler
    var controller= this.controller;
    var gateway   = this.controller.gateway;
    var svc       = this.controller.svc;
    
    this.controller.Debug (2,"[%s] connection err=%s", this.uid, err);
    this.end();
    this.adapter.ClientQuit(this);
    setTimeout (function(){ // wait for timeout and recreate a new Object from scratch
        gateway.controllers [svc] = new Controller (gateway, svcopts, svc);
    }, this.svcopts.timeout*1000);
}
203984
def _close_socket(self):
        
        try:
            self.socket.shutdown(socket.SHUT_RDWR)
        except (OSError, socket.error):
            pass
        self.socket.close()
1071290
def server_close(self):
        
        if self.remove_file:
            try:
                os.remove(self.remove_file)
            except:
                pass
        self.socket.close()
239807
protected void closeServerSocket() {
    ServerSocket serverSocket = getServerSocket();

    if (!close(serverSocket)) {
      getLogger().warning(() -> String.format(
        "Failed to close ServerSocket bound to address [%s], listening on port [%d]",
          serverSocket.getInetAddress(), serverSocket.getLocalPort()));
    }
  }
794026
def close(self):
        
        LOGGER.debug('Connection %s closing', self.id)
        if self.busy:
            raise ConnectionBusyError(self)
        with self._lock:
            if not self.handle.closed:
                try:
                    self.handle.close()
                except psycopg2.InterfaceError as error:
                    LOGGER.error('Error closing socket: %s', error)
523277
def _close_connection(self, frame_in):
        
        self._set_connection_state(Stateful.CLOSED)
        if frame_in.reply_code != 200:
            reply_text = try_utf8_decode(frame_in.reply_text)
            message = (
                'Connection was closed by remote server: %s' % reply_text
            )
            exception = AMQPConnectionError(message,
                                            reply_code=frame_in.reply_code)
            self._connection.exceptions.append(exception)
1287090
function () {
          // don't do it twice
          if (!tcpConnections[msg.tcpId]) return;

          exports.verbose(new Date(), 'Connection closed by remote peer for: ' + addressForLog(msg.address, msg.port));

          newCon.removeAllListeners();
          delete tcpConnections[msg.tcpId];
          send(channel, new MSG.Close(msg.tcpId));
        }
452469
def close_connection(self):
        
        if self.port:
            self.port.close()
            self.logger.debug("Close TCP port")
107326
def shutdown(self):
        """"""
        # Return early if this server has already exited.
        if not process.proc_alive(self.proc):
            return
        logger.info("Attempting to connect to %s", self.hostname)
        client = self.connection
        # Attempt the shutdown command twice, the first attempt might fail due
        # to an election.
        attempts = 2
        for i in range(attempts):
            logger.info("Attempting to send shutdown command to %s",
                        self.hostname)
            try:
                client.admin.command("shutdown", force=True)
            except ConnectionFailure:
                # A shutdown succeeds by closing the connection but a
                # connection error does not necessarily mean that the shutdown
                # has succeeded.
                pass
            # Wait for the server to exit otherwise rerun the shutdown command.
            try:
                return process.wait_mprocess(self.proc, 5)
            except TimeoutError as exc:
                logger.info("Timed out waiting on process: %s", exc)
                continue
        raise ServersError("Server %s failed to shutdown after %s attempts" %
                           (self.hostname, attempts))
1147902
def close(self):
        """"""

        try:
            self.sock.shutdown(socket.SHUT_RDWR)
            self.sock.close()
        except socket.error:
            pass
1361050
def sync_close_connection(self):
        """"""
        loop = asyncio.get_event_loop()
        task = loop.create_task(self.close_connection())
        loop.run_until_complete(task)
1011942
protected void closeServerSocket() {
        try {
            this.serverSocket.close();
        } catch (IOException ioe) {
            // no need to do anything except log it and dereference
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "IOExeption on ServerSocket.close " + ioe.getMessage());
            }
        }
    }
90497
public function close()
    {
        if($this->isUDP()) {
            Yii::warning("Clos UDP connection is meaningless.", 'beyod');
            return ;
        }
        
        $this->status = static::STATUS_CLOSED;
        $this->removeEventLooper();
        
        $this->trigger(Server::ON_CLOSE, new CloseEvent());
        $this->destroy();
    }
1278901
def close(self):
        """"""
        if not self.is_running:
            return

        self._state = CLOSED
        self.logger.debug('closing connection(s)')

        while True:
            try:
                conn = self._connections.get(block=False)
            except Empty:
                break

            conn.close_stream()

        self.on_close.send(self)
549081
public void close()
    throws IOException
  {
    ServerSocket ss = _ss;
    _ss = ss;

    if (ss != null) {
      try {
        ss.close();
      } catch (Exception e) {
      }
    }
  }
168302
function close()
    {
        if(!$this->socket) {
            return;
        }

        $this->sendDisconnect();
        stream_socket_shutdown($this->socket, STREAM_SHUT_RDWR);
        $this->socket = null;
    }
1321752
def close(self):
        """"""
        self.log.warning('Closing connection to AVR')
        self._closing = True
        if self.protocol.transport:
            self.protocol.transport.close()