Package org.spincast.core.websocket
Interface WebsocketEndpointManager
- All Superinterfaces:
WebsocketEndpointWriter
- All Known Subinterfaces:
WebsocketEndpoint
- All Known Implementing Classes:
SpincastWebsocketEndpoint
Manager for a WebSocket endpoint. Extends WebsocketEndpointWriter
since it can write on the endpoint, but also adds some managements
features.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Closes the entire WebSocket endpoint.void
closeEndpoint
(boolean sendClosingMessageToPeers) Closes the entire WebSocket endpoint.void
closeEndpoint
(int closingCode, String closingReason) Closes the entire WebSocket endpoint.void
Closes a specific peer connection on the endpoint.void
Closes a specific peer connection on the endpoint.The endpoint idThe connected peers' ids.boolean
isClosed()
Is this endpoint closed?boolean
Is this endpoint closing?Methods inherited from interface org.spincast.core.websocket.WebsocketEndpointWriter
sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessageExcept, sendMessageExcept, sendMessageExcept, sendMessageExcept
-
Method Details
-
getEndpointId
String getEndpointId()The endpoint id -
getPeersIds
The connected peers' ids. -
closePeer
Closes a specific peer connection on the endpoint. -
closePeer
Closes a specific peer connection on the endpoint. -
closeEndpoint
void closeEndpoint()Closes the entire WebSocket endpoint. All peer connections of this endpoint will be closed and the endpoint will be removed.Will try to send a "closing" message to the peers before closing their connection.
-
closeEndpoint
void closeEndpoint(boolean sendClosingMessageToPeers) Closes the entire WebSocket endpoint. All peer connections of this endpoint will be closed and the endpoint will be removed.- Parameters:
sendClosingMessageToPeers
- iftrue
, Spincast will try to send a "closing" message to the peers before closing their connections.
-
closeEndpoint
Closes the entire WebSocket endpoint. All peer connections of this endpoint will be closed and the endpoint will be removed.Will try to send a "closing" message to the peers before closing their connection.
-
isClosing
boolean isClosing()Is this endpoint closing? -
isClosed
boolean isClosed()Is this endpoint closed?
-