public interface ConnectionListener
Modifier and Type | Method and Description |
---|---|
void |
onActivityWarning(boolean warningOn)
Notification that the connection is stalled (i.e. nothing has been
received on the connection for more than the
ConnectionInfo.probeWarningMillis timeout)
or that the connection is working again after being notified as stalled. |
void |
onClose()
Notification of the closure of the Connection.
|
void |
onConnectionEstablished()
Notification of the opening of the connection to the Server.
|
void |
onDataError(PushServerException e)
Notification that a block of data received from the Server could not
be correctly interpreted.
|
void |
onEnd(int cause)
Notification of the closure of the Connection because of a Server side
decision.
|
void |
onFailure(PushConnException e)
Notification of the closure of the Connection because of a connection
problem.
|
void |
onFailure(PushServerException e)
Notification of the closure of the Connection because of an unrecoverable
error in data coming from the Server.
|
void |
onNewBytes(long bytes)
Notification of the reception of some data bytes from the Server,
for statistical purposes.
|
void |
onSessionStarted(boolean isPolling)
Notification that a session has been started by the Server
on the connection.
|
void onConnectionEstablished()
void onSessionStarted(boolean isPolling)
isPolling
- True if the session is in polling mode,
false if the session is in streaming mode.
The setting reflects the one requested with the LSClient.openConnection(com.lightstreamer.ls_client.ConnectionInfo, com.lightstreamer.ls_client.ConnectionListener)
call unless the Stream-sense mechanism has been exploited.void onNewBytes(long bytes)
bytes
- Number of data bytes received.void onDataError(PushServerException e)
e
- Exception that describes the problem occurred.void onActivityWarning(boolean warningOn)
ConnectionInfo.probeWarningMillis
timeout)
or that the connection is working again after being notified as stalled.
ConnectionInfo.probeTimeoutMillis
timeout,
then the connection is forcibly closed with an onFailure notification.warningOn
- if true, issues the warning for a stalled
connection; otherwise resets a previously issued warning.void onClose()
void onEnd(int cause)
cause
- An integer code that describes the cause of the connection
ending, or 0 if no cause information is supplied. See the "END" message
in the text protocol documentation for details on the possible causes.void onFailure(PushServerException e)
e
- Exception that describes the problem occurred.void onFailure(PushConnException e)
e
- Exception that describes the problem occurred.