| Modifier and Type | Method and Description |
|---|---|
ServerSentEvent |
OkSse.newServerSentEvent(okhttp3.Request request,
ServerSentEvent.Listener listener)
Create a new instance of
ServerSentEvent that will handle the connection and communication with
the SSE Server. |
| Modifier and Type | Method and Description |
|---|---|
void |
ServerSentEvent.Listener.onClosed(ServerSentEvent sse)
Notify that the connection was closed.
|
void |
ServerSentEvent.Listener.onComment(ServerSentEvent sse,
String comment)
Called every time a comment is received.
|
void |
ServerSentEvent.Listener.onMessage(ServerSentEvent sse,
String id,
String event,
String message)
Called every time a message is received.
|
void |
ServerSentEvent.Listener.onOpen(ServerSentEvent sse,
okhttp3.Response response)
Notify when the connection is open an established.
|
okhttp3.Request |
ServerSentEvent.Listener.onPreRetry(ServerSentEvent sse,
okhttp3.Request originalRequest)
Notifies client before retrying to connect.
|
boolean |
ServerSentEvent.Listener.onRetryError(ServerSentEvent sse,
Throwable throwable,
okhttp3.Response response)
Notify when the connection failed either because it could not be establish or the connection broke.
|
boolean |
ServerSentEvent.Listener.onRetryTime(ServerSentEvent sse,
long milliseconds)
The stream can define the retry time sending a message with "retry: milliseconds"
If this event is received this method will be called with the sent value
|
Copyright © 2018. All rights reserved.