PEAR Manual
Prev |  | Next

# Net_Socket::disconnect()

Net_Socket::disconnect() -- disconnects from a server

## Synopsis

    require_once 'Net/Socket.php';

``boolean Net_Socket::disconnect` ()`

## Description

Disconnects froms server, closes the socket.

## Return value

`boolean` - Returns `TRUE` on success, PEAR_Error on failure.

## Throws

Table 48-1. Possible PEAR_Error values

Error code | Error message | Reason | Solution
--- | --- | --- | ---
`NULL` | "not connected" | The connection to close was not open or is already closed. | Ensure a sucessfull call of connect()

## Note

This function can not be called statically.

## See

Net_Socket::connect()

Prev | Home | Next
Net_Socket::connect() | Up | Net_Socket::eof()