class Client

Methods

__construct()

No description

int
sendAsyncRequest(ConfiguresSocketConnection $connection, ProvidesRequestData $request)

No description

readResponse(int $socketId, int|null $timeoutMs = null)

No description

void
waitForResponse(int $socketId, int|null $timeoutMs = null)

Waits until the response is received and notifies the response callbacks of the request.

void
waitForResponses(int|null $timeoutMs = null)

Waits until all responses are received and notifies the callbacks of their requests.

bool
hasUnhandledResponses()

No description

bool
hasResponse(int $socketId)

No description

array
getSocketIdsHavingResponse()

No description

readResponses(int|null $timeoutMs = null, int ...$socketIds)

No description

readReadyResponses(int|null $timeoutMs = null)

No description

void
handleResponse(int $socketId, int|null $timeoutMs = null)

No description

void
handleResponses(int|null $timeoutMs = null, int ...$socketIds)

No description

void
handleReadyResponses(int|null $timeoutMs = null)

No description

Details

at line 55
__construct()

No description

at line 72
ProvidesResponseData sendRequest(ConfiguresSocketConnection $connection, ProvidesRequestData $request)

at line 92
int sendAsyncRequest(ConfiguresSocketConnection $connection, ProvidesRequestData $request)

No description

Parameters

ConfiguresSocketConnection $connection
ProvidesRequestData $request

Return Value

int SocketId

Exceptions

TimedoutException
WriteFailedException
ConnectException

at line 118
ProvidesResponseData readResponse(int $socketId, int|null $timeoutMs = null)

No description

Parameters

int $socketId
int|null $timeoutMs

Return Value

ProvidesResponseData

Exceptions

Throwable

at line 143
void waitForResponse(int $socketId, int|null $timeoutMs = null)

Waits until the response is received and notifies the response callbacks of the request.

If a timeout is given and there is no response within it, the failure callbacks are notified with a TimedoutException. Without a timeout, it waits until the response is received. The timeout also applies to reading the response, the read/write timeout of the connection by default.

Parameters

int $socketId
int|null $timeoutMs

Return Value

void

Exceptions

ReadFailedException

at line 172
void waitForResponses(int|null $timeoutMs = null)

Waits until all responses are received and notifies the callbacks of their requests.

If a timeout is given, requests without response within it notify their failure callbacks with a TimedoutException. Without a timeout, it waits until all responses are received. The timeout also applies to reading each response, the read/write timeout of the connection by default.

Parameters

int|null $timeoutMs

Return Value

void

Exceptions

ReadFailedException
Throwable

at line 245
bool hasUnhandledResponses()

No description

Return Value

bool

at line 256
bool hasResponse(int $socketId)

No description

Parameters

int $socketId

Return Value

bool

Exceptions

ReadFailedException

at line 265
array getSocketIdsHavingResponse()

No description

Return Value

array

Exceptions

ReadFailedException

at line 299
Generator readResponses(int|null $timeoutMs = null, int ...$socketIds)

No description

Parameters

int|null $timeoutMs
int ...$socketIds

Return Value

Generator

at line 324
Generator readReadyResponses(int|null $timeoutMs = null)

No description

Parameters

int|null $timeoutMs

Return Value

Generator

Exceptions

ReadFailedException

at line 340
void handleResponse(int $socketId, int|null $timeoutMs = null)

No description

Parameters

int $socketId
int|null $timeoutMs

Return Value

void

Exceptions

ReadFailedException

at line 354
void handleResponses(int|null $timeoutMs = null, int ...$socketIds)

No description

Parameters

int|null $timeoutMs
int ...$socketIds

Return Value

void

Exceptions

ReadFailedException

at line 367
void handleReadyResponses(int|null $timeoutMs = null)

No description

Parameters

int|null $timeoutMs

Return Value

void

Exceptions

ReadFailedException