public class Connection extends EventEmitter<ConnectionState,ConnectionStateListener>
EventEmitter.Filter| Modifier and Type | Field and Description |
|---|---|
ConnectionManager |
connectionManager |
java.lang.String |
id
A public identifier for this connection, used to identify
this member in presence events and message ids.
|
java.lang.String |
key
The assigned connection key.
|
ErrorInfo |
reason
Error information associated with a connection failure.
|
long |
serial
The serial number of the last message to be received on this connection.
|
ConnectionState |
state
The current state of this Connection.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
apply(ConnectionStateListener listener,
ConnectionState state,
java.lang.Object... args) |
void |
close()
Causes the connection to close, entering the closed state, from any state except
the failed state.
|
void |
connect()
Causes the library to re-attempt connection, if it was previously explicitly
closed by the user, or was closed as a result of an unrecoverable error.
|
void |
onConnectionStateChange(ConnectionStateListener.ConnectionStateChange stateChange) |
void |
ping(CompletionListener listener)
Send a heartbeat message to the Ably service and await a response.
|
public ConnectionState state
public ErrorInfo reason
public java.lang.String key
public java.lang.String id
public long serial
public final ConnectionManager connectionManager
public void connect()
public void ping(CompletionListener listener)
listener: - a listener to be notified of the outcome of this message.public void close()
connect().public void onConnectionStateChange(ConnectionStateListener.ConnectionStateChange stateChange)
protected void apply(ConnectionStateListener listener, ConnectionState state, java.lang.Object... args)
apply in class EventEmitter<ConnectionState,ConnectionStateListener>