Close the ZAP socket
358896
def stop(self):
        """"""
        if self.zap_socket:
            self.log.debug(
                'Stopping ZAP at {}'.format(self.zap_socket.LAST_ENDPOINT))
            super().stop()
168302
function close()
    {
        if(!$this->socket) {
            return;
        }

        $this->sendDisconnect();
        stream_socket_shutdown($this->socket, STREAM_SHUT_RDWR);
        $this->socket = null;
    }
420430
def close(self):
        """"""
        with self.lock:
            if self.device is not None:
                try:
                    self.device.close()
                except IOError:
                    pass
                self.device = None
337248
def close(self):
        """"""
        if self.sock is not None:
            try:
                self.sock.close()
            except Exception:
                pass
            finally:
                self.sock = None
375344
def teardown_socket(s):
  """"""
  try:
    s.shutdown(socket.SHUT_WR)
  except socket.error:
    pass
  finally:
    s.close()
233494
public void close() {
    try {
      if (conn != null) {
        conn.close();
      }
    } catch (IOException ignored) { }

    if (zkClient != null) {
      zkClient.stopAndWait();
    }
  }
556476
def close(self):
        
        if not self.active:
            return
        self.stop_thread()
        for chan in list(self._channels.values()):
            chan._unlink()
        self.sock.close()
199
def end(self, close_fileobj=True):
        """"""
        log.debug("in TftpContext.end - closing socket")
        self.sock.close()
        if close_fileobj and self.fileobj is not None and not self.fileobj.closed:
            log.debug("self.fileobj is open - closing")
            self.fileobj.close()
816156
void closeSocketImpl() {
        this.currentServerURI = null;

        // Signal the reader and writer
        this.reader.stop();
        this.writer.stop();

        // Close the current socket and cancel anyone waiting for it
        this.dataPortFuture.cancel(true);

        try {
            if (this.dataPort != null) {
                this.dataPort.close();
            }
        } catch (IOException ex) {
            processException(ex);
        }

        cleanUpPongQueue();

        // We signaled now wait for them to stop
        try {
            this.reader.stop().get(10, TimeUnit.SECONDS);
        } catch (Exception ex) {
            processException(ex);
        }
        try {
            this.writer.stop().get(10, TimeUnit.SECONDS);
        } catch (Exception ex) {
            processException(ex);
        }
    }
369197
def close(self):
        
        logging.debug("closing interface")
        self.closed = True
        self.read_sem.release()
        self.thread.join()
        usb.util.dispose_resources(self.dev)
1126501
def _close_connection(self):
        """"""
        if (self._mode == PROP_MODE_SERIAL):
            self._serial.close()
        elif (self._mode == PROP_MODE_TCP):
            self._socket.close()
        elif (self._mode == PROP_MODE_FILE):
            self._file.close()
878875
def close(self):
        """"""
        close_command = StandardSend(self._address,
                                     COMMAND_LIGHT_OFF_0X13_0X00)
        self._send_method(close_command, self._closed_message_received)
1300271
def close(self, kill_restart=True):
        '''
        
        '''
        self.do_not_restart = kill_restart
        self.zoo_client.stop()
        self.zoo_client.close()
186526
private void close()
    {
        assert (fd != null);

        try {
            fd.close();
            socket.eventClosed(endpoint, fd);
        }
        catch (IOException e) {
            socket.eventCloseFailed(endpoint, ZError.exccode(e));
        }
        fd = null;
    }
661854
def close(self):
        """"""
        logger.debug('closing dongle, {} active connections'.format(len(self.conn_handles)))
        if self.is_scanning():
            logger.debug('in scanning mode, calling end_scan')
            self.end_scan()
        self.reset()
        if self.api is not None:
            self.api.stop_daemon()
            self.api = None
996045
def close(self):
        """"""
        windll.kernel32.CloseHandle(self.conout_pipe)
        windll.kernel32.CloseHandle(self.conin_pipe)
740100
public function close()
    {
        if (!is_resource($this->socket)) {
            return;
        }

        fclose($this->socket);
        $this->socket = null;
    }