Interface WebSocket
public interface WebSocket
- Author:
- Jeoffrey HAEYAERT (jeoffrey.haeyaert at graviteesource.com), GraviteeSource Team
-
Method Summary
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.Completableclose()Closes the websocket without any status.io.reactivex.rxjava3.core.Completableclose(int status) Closes the websocket with the specified status.io.reactivex.rxjava3.core.CompletableCloses the websocket with the specified status and reason.booleanclosed()Indicates if websocket is closed or not.io.reactivex.rxjava3.core.Flowable<Buffer>read()Returns the websocket incomingFlowableofBuffer.io.reactivex.rxjava3.core.Single<WebSocket>upgrade()Upgrades the associated http request to websocket and returns the same instance once the upgrade has been performed.booleanupgraded()Indicates if the http request has already been upgraded to websocket or not.io.reactivex.rxjava3.core.CompletableWrites the buffer to the websocket as a binary frame.io.reactivex.rxjava3.core.CompletableWrites a ping frame to the connection.
-
Method Details
-
upgrade
io.reactivex.rxjava3.core.Single<WebSocket> upgrade()Upgrades the associated http request to websocket and returns the same instance once the upgrade has been performed.- Returns:
- a
Singleof the sameWebSocketinstance once the upgrade performed.
-
write
Writes the buffer to the websocket as a binary frame.- Parameters:
buffer- the buffer to write.- Returns:
- a
Completablethat completes once writing has been performed.
-
writePing
io.reactivex.rxjava3.core.Completable writePing()Writes a ping frame to the connection.This method should only be used for implementing a keep alive or to ensure the client is still responsive, see RFC 6455 Section section 5.5.2.
- Returns:
- a
Completablethat completes once writing has been performed.
-
read
io.reactivex.rxjava3.core.Flowable<Buffer> read()Returns the websocket incomingFlowableofBuffer.- Returns:
- a
FlowableofBuffer.
-
close
io.reactivex.rxjava3.core.Completable close()Closes the websocket without any status.- Returns:
- a
Completablethat completes once the close has been performed.
-
close
io.reactivex.rxjava3.core.Completable close(int status) Closes the websocket with the specified status.- Returns:
- a
Completablethat completes once the close has been performed.
-
close
Closes the websocket with the specified status and reason.- Returns:
- a
Completablethat completes once the close has been performed.
-
upgraded
boolean upgraded()Indicates if the http request has already been upgraded to websocket or not.- Returns:
trueif it has been upgraded,falseotherwise.- See Also:
-
closed
boolean closed()Indicates if websocket is closed or not.- Returns:
trueif it is already closed,falseotherwise.- See Also:
-