Send a shutdown signal for reading - you may no longer read from this
        socket.
433037
def shutdown_rd(self):
        
        if self._sock_send is not None:
            self.sock.close()
        else:
            return self.shutdown(socket.SHUT_RD)
284137
def disconnect(send_msg = true)
      # Stop reading packets from the socket first
      @read_thread.kill if @read_thread && @read_thread.alive?
      @read_thread = nil

      return unless connected?

      # Close the socket if it is open
      if send_msg
        packet = MQTT::Packet::Disconnect.new
        send_packet(packet)
      end
      @socket.close unless @socket.nil?
      @socket = nil
    end
845688
public void shutdown() {
    getLogger().info(getPath() + " shutdown");
    active = false;
    try {
      if (reader != null) {
        reader.close();
        reader = null;
      }
    } catch (IOException ioe) {
      ioe.printStackTrace();
    }
  }
471999
def shutdown(self):
        """"""

        if self.verbose:
            print(self.socket.getsockname(), 'xx', self.peername)

        try:
            self.socket.shutdown(socket.SHUT_RDWR)
        except IOError as err:
            assert err.errno is _ENOTCONN, "unexpected IOError: %s" % err
            # remote peer has already closed the connection,
            # just ignore the exceeption
            pass
1031828
def close(self):
        """"""
        try:
            self._socket.sendall('quit\r\n')
        except socket.error:
            pass
        try:
            self._socket.close()
        except socket.error:
            pass
1073791
public synchronized void shutdown() {
    getLogger().debug(getName() + " received shutdown request");

    // mark this as no longer running
    active = false;

    if (rThread != null) {
      rThread.interrupt();
      rThread = null;
    }
    if (advertiseViaMulticastDNS) {
        zeroConf.unadvertise();
    }

    doShutdown();
  }
408866
def close(self):
        
        if self._socket:
            if USE_STDLIB_SSL:
                # NB: Python 2.7.8 and earlier does not have a compatible
                # shutdown() method due to the SSL lib
                try:
                    self._socket.shutdown(socket.SHUT_RDWR)
                except EnvironmentError:
                    # NB: sometimes these exceptions are raised if the initial
                    # connection didn't succeed correctly, or if shutdown() is
                    # called after the connection dies
                    logging.debug('Exception occurred while shutting '
                                  'down socket.', exc_info=True)
            self._socket.close()
            del self._socket
347878
def close(self):
        """"""
        if self.sock:
            self.sock.close()
        self.sock = 0
        self.eof = 1
770559
def stop(self):
        """"""
        self._stop_thread.set()
        # f you want to close the connection in a timely fashion,
        # call shutdown() before close().
        with self._lock:  # Receive thread might use the socket
            self.receive_socket.shutdown(socket.SHUT_RDWR)
            self.receive_socket.close()

        self.send_socket.shutdown(socket.SHUT_RDWR)
        self.send_socket.close()
568724
def socket_close(self):
        """"""
        if self.sock != NC.INVALID_SOCKET:
            self.sock.close()
        self.sock = NC.INVALID_SOCKET
629952
protected Object shutdown() throws IOException {
	logger.debug("shutdown");

	// close the socket
	writer.close();

	// garbage collect the socket
	socketBox.setSocket(null);

	// attempt to obtain permission to close data source
	Object quitToken = context.getQuitToken();

	// data source is shared by all data channels,
	// so should be closed by the last one exiting
	if (quitToken != null) {
	    source.close();
	}

	return quitToken;
    }
1301709
def stop(self):
        
        self.publish.setsockopt(zmq.LINGER, 1)
        self.publish.close()
        return self
1028521
def stop(self):
        """"""
        if self.closed:
            raise ConnectionClosed()

        if self.read_watcher.active:
            self.read_watcher.stop()
        if self.write_watcher.active:
            self.write_watcher.stop()
198998
def close_socket(self):
        """"""
        if _debug: UDPDirector._debug("close_socket")

        self.socket.close()
        self.close()
        self.socket = None
590158
def _shutdown_transport(self):
        """"""
        if self.sock is not None:
            try:
                unwrap = self.sock.unwrap
            except AttributeError:
                return
            try:
                self.sock = unwrap()
            except ValueError:
                # Failure within SSL might mean unwrap exists but socket is not
                # deemed wrapped
                pass
778509
public void shutdown() {
        shuttingDown = true;
        try {
            SocketAddress localAddress = serverSocket.getLocalAddress();
            if (localAddress instanceof InetSocketAddress) {
                InetSocketAddress address = (InetSocketAddress) localAddress;
                Socket client = new Socket(address.getHostName(), address.getPort());
                client.setSoTimeout(1000); // waking the acceptor loop should be quick
                new PingAgentProtocol().connect(client);
            }
        } catch (IOException e) {
            LOGGER.log(Level.FINE, "Failed to send Ping to wake acceptor loop", e);
        }
        try {
            serverSocket.close();
        } catch (IOException e) {
            LOGGER.log(Level.WARNING, "Failed to close down TCP port",e);
        }
    }
20215
public synchronized void shutdown() {
    // mark this as no longer running
    active = false;

    // close the socket
    try {
      if (socketNode != null) {
        socketNode.close();
        socketNode = null;
      }
    } catch (Exception e) {
      getLogger().info("Excpetion closing socket", e);
      // ignore for now
    }

    // stop the connector
    if (connector != null) {
      connector.interrupted = true;
      connector = null;  // allow gc
    }
    if (advertiseViaMulticastDNS) {
        zeroConf.unadvertise();
    }
  }