public interface Pings extends Feature
The main purpose of a ping is to test, at a very basic level, the current network conditions that exist between the client session and the server it is connected to. Each ping request will return details on the latency experienced in the form of a round-trip time value.
session
as follows:
Pings pings = session.feature(Pings.class);
Modifier and Type | Interface and Description |
---|---|
static interface |
Pings.PingCallback
Callback interface for
pingServer(PingCallback) . |
static interface |
Pings.PingContextCallback<C>
Callback interface for
pingServer(Object, PingContextCallback) . |
static interface |
Pings.PingDetails
Details returned with a response from a ping to the server.
|
Modifier and Type | Method and Description |
---|---|
<C> void |
pingServer(C context,
Pings.PingContextCallback<C> callback)
Sends a ping request to the server.
|
void |
pingServer(Pings.PingCallback callback)
Sends a ping request to the server.
|
getSession
void pingServer(Pings.PingCallback callback) throws IllegalArgumentException, SessionClosedException
The callback
's onPingResponse
method will be called with the response.
callback
- the callback for the response to this ping operationIllegalArgumentException
- if callback
is nullSessionClosedException
- if the session is closed<C> void pingServer(C context, Pings.PingContextCallback<C> callback) throws IllegalArgumentException, SessionClosedException
The callback
's
onPingResponse
method will be called with the response.
C
- context object typecontext
- the context object that will be passed to the callbackcallback
- the callback for the response to this ping operationIllegalArgumentException
- if callback
is nullSessionClosedException
- if the session is closedCopyright © 2016 Push Technology Ltd. All Rights Reserved.