Index Documentation

IpEndPoint extends EndPoint
in package

Represents an IP address end point.

Table of Contents

Methods

__construct()  : mixed
__serialize()  : array<string|int, mixed>
__toString()  : string
__unserialize()  : void
equals()  : bool
Checks whether the current object is equal to another.
getAddress()  : IpAddress
Returns the IP address.
getPort()  : int
Retrieves port number.
hasPort()  : bool
Whether a port is specified.
jsonSerialize()  : mixed
parse()  : IpEndPoint
Attempts to parse a string into an IP end point.

Methods

__construct()

public __construct(IpAddress $address, int $port) : mixed
Parameters
$address : IpAddress

IP address.

$port : int

Network port, 0 to leave default.

Tags
throws
InvalidArgumentException

If $port is less than 0 or greater than 65535.

__serialize()

public __serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>

__toString()

public __toString() : string
Return values
string

__unserialize()

public __unserialize(IpAddress, : int} $serialized) : void
Parameters
$serialized : IpAddress, : int}

equals()

Checks whether the current object is equal to another.

public equals(mixed $other) : bool
Parameters
$other : mixed
Return values
bool

true if the objects are equals, false if not.

getPort()

Retrieves port number.

public getPort() : int
Return values
int

Network port number.

hasPort()

Whether a port is specified.

public hasPort() : bool
Return values
bool

true if the port number is greater than 0.

jsonSerialize()

public jsonSerialize() : mixed

parse()

Attempts to parse a string into an IP end point.

public static parse(string $string) : IpEndPoint
Parameters
$string : string

String to parse.

Tags
throws
InvalidArgumentException

If $string does not contain a valid IP end point string.

Return values
IpEndPoint

Representation of the given string.


        
On this page

Search results