Closes IP socket

@return boolean
550265
public function disconnect() {
        if ($this->socket) {
            if (!fclose($this->socket)) {
                throw new \Exception("Error while closing telnet socket");
            }
            $this->socket = NULL;
        }
        return true;
    }
891156
def close(self):
        

        if not (yield from super().close()):
            return False

        nio = self._ethernet_adapter.get_nio(0)
        if isinstance(nio, NIOUDP):
            self.manager.port_manager.release_udp_port(nio.lport, self._project)

        if self._local_udp_tunnel:
            self.manager.port_manager.release_udp_port(self._local_udp_tunnel[0].lport, self._project)
            self.manager.port_manager.release_udp_port(self._local_udp_tunnel[1].lport, self._project)
            self._local_udp_tunnel = None

        yield from self._stop_ubridge()

        if self.is_running():
            self._terminate_process()

        return True
1140007
protected void closeServerSocket() {
        // Close server socket, we do not accept new requests anymore.
        // This also terminates the server thread if blocking on socket.accept.
        if (null != serverSocket) {
            try {
                if (!serverSocket.isClosed()) {
                    serverSocket.close();
                    if (log.isTraceEnabled()) {
                        log.trace("Closed server socket " + serverSocket + "/ref="
                                + Integer.toHexString(System.identityHashCode(serverSocket))
                                + " for " + getName());
                    }
                }
            } catch (IOException e) {
                throw new IllegalStateException("Failed to successfully quit server " + getName(), e);
            }
        }
    }
1033728
public function quit()
	{
		// If native FTP support is enabled lets use it...
		if (FTP_NATIVE)
		{
			@ftp_close($this->conn);

			return true;
		}

		// Logout and close connection
		@fwrite($this->conn, "QUIT\r\n");
		@fclose($this->conn);

		return true;
	}
919479
public function close()
    {
        if (!$this->isConnected()) {
            throw new ConnectionUnestablishedException("Tried to close an unitialized connection");
        }

        ftp_close($this->stream);

        $this->connected = false;

        return true;
    }
273471
public function disconnect()
    {
        if (!$this->socket) {
            return $this;
        }

        try {
            $this->send('QUIT');
        } catch (Argument $e) {
            // ignore error - we're closing the socket anyway
        }

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

        return $this;
    }
74037
function close()
    {
        $this->flush();
        $this->_opened = false;
        if ($this->_closeResource === true && is_resource($this->_stream)) {
            fclose($this->_stream);
        }
        return true;
    }
1049650
function close($socket) {
		if (isset($this->agents[(int)$socket]))
			unset($this->sockets[(int)$socket],$this->agents[(int)$socket]);
		stream_socket_shutdown($socket,STREAM_SHUT_WR);
		@fclose($socket);
	}
813190
public function close()
    {
        if ($this->closed) {
            return false;
        }
        $this->closed = true;
        if ($this->fdCacheKey !== null) {
            FileSystem::$fdCache->invalidate($this->fdCacheKey);
        }
        if ($this->fd === null) {
            return false;
        }

        if (!FileSystem::$supported) {
            fclose($this->fd);
            return false;
        }
        $r = eio_close($this->fd, EIO_PRI_MAX);
        $this->fd = null;
        return $r;
    }
367966
public function disconnect()
	{
		if (is_resource($this->_hSocket)) {
			$this->_log('INFO: Disconnected.');
			return fclose($this->_hSocket);
		}
		return false;
	}
1344213
def close_socket(self):
        ''''''
        log.debug("Closing socket")
        if self.sock:
            try:
                self.sock.close()
            except:
                pass

            self.sock = None
950986
public function disconnect() {
    if ($this->connected) {
      if (is_resource($this->link)) {
        pg_close($this->link);
      }
      $this->connected = false;
    }
    return $this->connected;
  }
1180393
protected function _close() {
        if ($this->isConnected()) {
            fclose($this->_varnishConn);
            $this->_varnishConn = null;
        }
        return $this;
    }
1324051
public function disconnect()
    {
        $streamResource = $this->getStreamResource();

        if (is_resource($streamResource)) {
            stream_socket_shutdown($streamResource, STREAM_SHUT_RDWR);
            $this->streamResource = null;
        }

        return $this;
    }
652435
public function close() : Bool
    {
        $init = $this->init;

        if( is_resource($init) )
        {
            $this->init = NULL;

            curl_close($init);

            return true;
        }

        return false;
    }
1369863
public function close()
    {
        $this->requireOpenConnection();

        $response = $this->curl(
            'DELETE',
            '/proxy/' . $this->port
        );

        $this->closed = true;
    }
282233
function close() {
        $this->_error_log('closing socket ' . $this->sock);
        $this->_connection_closed = true;
        fclose($this->sock);
    }