Close the listening socket.
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;
    }
282233
function close() {
        $this->_error_log('closing socket ' . $this->sock);
        $this->_connection_closed = true;
        fclose($this->sock);
    }
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()
168891
def pub_close(self):
        '''
        
        '''
        if hasattr(self._sock_data, 'sock'):
            self._sock_data.sock.close()
            delattr(self._sock_data, 'sock')
192602
def close_connection(self):
        """"""
        self._logger.info('Closing connection')
        self._closing = True
        self._connection.close()
259687
def close(self):
        
        if not self.__closed:
            self.__closed = True
            self.pool.return_socket(self.sock)
            self.sock, self.pool = None, None
1081095
def close_socket(sock):
    ''''''
    if sock:
        try:
            sock.shutdown(socket.SHUT_RDWR)
        except Exception:
            pass
        try:
            sock.close()
        except Exception:
            pass
442912
def stop_listening(cls, event, func):
        """"""
        signal(event).disconnect(func, sender=cls)
1170643
protected void disconnect() {

		// Stop broadcaster
		if (locator != null) {
			locator.disconnect();
			locator = null;
		}

		// Stop gossiper's timer
		if (gossiperTimer != null) {
			gossiperTimer.cancel(false);
			gossiperTimer = null;
		}

		// Close socket reader
		if (reader != null) {
			reader.disconnect();
			reader = null;
		}

		// Close socket writer
		if (writer != null) {
			writer.disconnect();
			writer = null;
		}
	}
93998
def _close(self, e):
        
        self.stop()
        self.sock.close()
        self.closed = True
        self.close_cb(e)
185686
def close(self):
        
        self._socket.close()
        if self._async_socket_cache:
            self._async_socket_cache.close()
            self._async_socket_cache = None
438580
public void disconnect() {

		if (!connected) {
			return;
		}

		try {
			socket.close();
		} catch (IOException e) {
			LOG.debug("I/O exception when closing socket", e);
		}

		this.connected = false;
	}
1371515
protected function close()
    {
        if ($this->socket !== false) {
            fclose($this->socket);
            $this->socket = false;
        }
    }
491837
def quit(self):
        """"""
        # stop all threads and close the socket
        self.receive_thread.stopped = True
        # self.receive_thread._Thread__stop()

        self.message_thread.stopped = True
        # self.message_thread._Thread__stop()

        # self.ping_thread.stopped = True
        # self.ping_thread._Thread__stop()

        self.receive_thread.join()
        _LOGGER.info('receive_thread exited')
        self.message_thread.join()
        _LOGGER.info('message_thread exited')

        self.socket.close()
271632
def stop(self):
        
        self.listener.setsockopt(LINGER, 1)
        self.loop = False
        with nslock:
            self.listener.close()
1031828
def close(self):
        """"""
        try:
            self._socket.sendall('quit\r\n')
        except socket.error:
            pass
        try:
            self._socket.close()
        except socket.error:
            pass
64378
def close(self):
        

        # Close the underlying socket
        if self._sock:
            with utils.ignore_except():
                self._sock.close()
            self._sock = None

        # Purge the message buffers
        self._recvbuf = []
        self._recvbuf_partial = ''