Net_Socket::connect()

Net_Socket::connect() -- connects to a server

Referentiesamenvatting

require_once 'Net/Socket.php';

boolean Net_Socket::connect (string $addr, integer $port, boolean [$persistent = NULL], integer [$timeout = NULL])

Beschrijving

Connect to the specified port. If called when the socket is already connected, it disconnects and connects again.

Return waarde

boolean - Geeft TRUE terug bij success, PEAR_Error als het faalt.

Throws

Tabel 49-1. Mogelijke PEAR_Error waarden

Error codeError messageReasonSolution
everyevery The connection could not be established because

  • wrong server name or adress

  • the host itself is not link to a network

  • a firewall does not allow an access

Check for server name, the connection to the net and possible firewalls on client or server side

Note

Deze functie kan niet statisch worden aangeroepen.

Zie

Net_Socket::disconnect()