final class SocketCollection implements Countable

Methods

new(ConfiguresSocketConnection $connection, EncodesPacket $packetEncoder, EncodesNameValuePair $nameValuePairEncoder)

No description

getById(int $socketId)

No description

array
getSocketIdsByResources(array $resources)

No description

getByResource(resource $resource)

No description

void
remove(int $socketId)

No description

Socket|null
getIdleSocket(ConfiguresSocketConnection $connection)

No description

bool
hasBusySockets()

No description

array
getBusySockets()

No description

int
getStreamSelectTimeout()

Returns the smallest stream select timeout of all sockets waiting for a response, so that none of them is checked less often than its connection is configured to.

array
collectResources()

No description

array
collectResourcesOfBusySockets()

Only sockets that wait for a response can have a new one. An idle socket becomes readable as well, when the server closes its connection, but it only has the response that was already read.

int
count()

No description

bool
isEmpty()

No description

Details

at line 28
Socket new(ConfiguresSocketConnection $connection, EncodesPacket $packetEncoder, EncodesNameValuePair $nameValuePairEncoder)

No description

Parameters

ConfiguresSocketConnection $connection
EncodesPacket $packetEncoder
EncodesNameValuePair $nameValuePairEncoder

Return Value

Socket

Exceptions

Exception
WriteFailedException

at line 59
Socket getById(int $socketId)

No description

Parameters

int $socketId

Return Value

Socket

Exceptions

ReadFailedException

at line 72
array getSocketIdsByResources(array $resources)

No description

Parameters

array $resources

Return Value

array

Exceptions

ReadFailedException

at line 89
Socket getByResource(resource $resource)

No description

Parameters

resource $resource

Return Value

Socket

Exceptions

ReadFailedException

at line 117
void remove(int $socketId)

No description

Parameters

int $socketId

Return Value

void

at line 122
Socket|null getIdleSocket(ConfiguresSocketConnection $connection)

No description

Parameters

ConfiguresSocketConnection $connection

Return Value

Socket|null

at line 153
bool hasBusySockets()

No description

Return Value

bool

at line 174
array getBusySockets()

No description

Return Value

array

at line 195
int getStreamSelectTimeout()

Returns the smallest stream select timeout of all sockets waiting for a response, so that none of them is checked less often than its connection is configured to.

Return Value

int

Timeout in milliseconds

at line 213
array collectResources()

No description

Return Value

array

at line 231
array collectResourcesOfBusySockets()

Only sockets that wait for a response can have a new one. An idle socket becomes readable as well, when the server closes its connection, but it only has the response that was already read.

Return Value

array

at line 246
int count()

No description

Return Value

int

at line 251
bool isEmpty()

No description

Return Value

bool