class SocketAddress

Constants

DEFAULT_TIMEOUT

PROTOCOL_TCP

Properties

IP $address
Port $port

Methods

__construct(IP $address, Port $port)

No description

static SocketAddress
from(string $ip, int $port, Protocol $protocol = Protocol::TCP)

Gets new socket address from specified IP, port and protocol information.

bool
isOpen()

Determines if a TCP socket is open

Details

at line 30
__construct(IP $address, Port $port)

No description

Parameters

IP $address
Port $port

at line 40
static SocketAddress from(string $ip, int $port, Protocol $protocol = Protocol::TCP)

Gets new socket address from specified IP, port and protocol information.

This method takes care to creates the underlying IP and Port object.

Parameters

string $ip
int $port
Protocol $protocol

Return Value

SocketAddress

at line 60
bool isOpen()

Determines if a TCP socket is open

Return Value

bool

if the TCP socket accepts a connection

Exceptions

RuntimeException