Close the sockets
185686
def close(self):
        
        self._socket.close()
        if self._async_socket_cache:
            self._async_socket_cache.close()
            self._async_socket_cache = None
1368166
public function close()
    {
        if (isset($this->ev)) {
            $this->ev = null;
        }
        if ($this->pid !== posix_getpid()) { // preventing closing pre-bound sockets in workers
            return;
        }
        if (is_resource($this->fd)) {
            socket_close($this->fd);
        }
    }
679624
def close(self):
        
        self.stopped.set()
        for event in self.to_be_stopped:
            event.set()
        if self._receiver_thread is not None:
            self._receiver_thread.join()
        self._socket.close()
572812
def shutdown(self):
        """"""
        self.stop_all_periodic_tasks()
        for channel in self._bcm_sockets:
            log.debug("Closing bcm socket for channel {}".format(channel))
            bcm_socket = self._bcm_sockets[channel]
            bcm_socket.close()
        log.debug("Closing raw can socket")
        self.socket.close()
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()
120701
def close(self):
        
        log.debug("Closing socket connection for %s:%d" % (self.host, self.port))
        if self._sock:
            # Call shutdown to be a good TCP client
            # But expect an error if the socket has already been
            # closed by the server
            try:
                self._sock.shutdown(socket.SHUT_RDWR)
            except socket.error:
                pass

            # Closing the socket should always succeed
            self._sock.close()
            self._sock = None
        else:
            log.debug("No socket found to close!")
719921
def close(self):
        '''
        
        '''
        #write all that is remained in buffer
        self.flush()
        # delete buffer
        self.__buffer = None
        #reset buffer index to -1 to indicate no where
        self.__bufferidx = -1
        #writing the final empty chunk to the socket
        # send here the data
        self.conn.send("0\r\n")
        self.conn.send("\r\n" )
        #set closed flag
        self.__closed = True
179227
private function close()
    {
        if (null !== $this->pipe && $this->pipe->isOpen()) {
            $this->pipe->close();
        }

        if (is_resource($this->socket)) {
            fclose($this->socket);
        }

        $this->thread = null;
        $this->channel = null;
    }
851489
protected void close()
    {
        assert (fd != null);
        try {
            fd.close();
            socket.eventClosed(addr.toString(), fd);
        }
        catch (IOException e) {
            socket.eventCloseFailed(addr.toString(), ZError.exccode(e));
        }
        fd = null;
    }
996045
def close(self):
        """"""
        windll.kernel32.CloseHandle(self.conout_pipe)
        windll.kernel32.CloseHandle(self.conin_pipe)
341943
def stop(self):
        
        if self.socket is not None:
            self.socket.close()
            self.socket = None
            self.data = None
198998
def close_socket(self):
        """"""
        if _debug: UDPDirector._debug("close_socket")

        self.socket.close()
        self.close()
        self.socket = None
501129
def close(self):
        
        try:
            # TODO: Find a way to speed up this shutdown.
            if self.ssl:
                self._device.shutdown()

            else:
                # Make sure that it closes immediately.
                self._device.shutdown(socket.SHUT_RDWR)

        except Exception:
            pass

        Device.close(self)
1075804
def stop(self):
        """"""
        self.logger.warning("Stop executed")
        try:
            self._socket.close()
        except Exception:
            self.logger.error("Error while closing socket")
            raise VelbusException("Error while closing socket")
        time.sleep(1)
1344213
def close_socket(self):
        ''''''
        log.debug("Closing socket")
        if self.sock:
            try:
                self.sock.close()
            except:
                pass

            self.sock = None
347878
def close(self):
        """"""
        if self.sock:
            self.sock.close()
        self.sock = 0
        self.eof = 1
632888
def remove_socket(self, socket):
        
        if socket in self._sockets:
            socket.on_closed.disconnect(self.remove_socket)
            self._sockets.remove(socket)