public.javadoc.org.spincast.plugins.undertow.SpincastUndertowWebsocketEndpointWriter.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spincast-website Show documentation
Show all versions of spincast-website Show documentation
Source code for the https://www.spincast.org website.
SpincastUndertowWebsocketEndpointWriter (org.spincast:spincast-framework 1.2.0 API)
org.spincast.plugins.undertow
Class SpincastUndertowWebsocketEndpointWriter
- java.lang.Object
-
- org.spincast.plugins.undertow.SpincastUndertowWebsocketEndpointWriter
-
- All Implemented Interfaces:
- UndertowWebsocketEndpointWriter
public class SpincastUndertowWebsocketEndpointWriter
extends Object
implements UndertowWebsocketEndpointWriter
-
-
Nested Class Summary
Nested Classes
Modifier and Type
Class and Description
protected static interface
SpincastUndertowWebsocketEndpointWriter.IWriteExecutor
Interface to create a write executor.
-
Field Summary
Fields
Modifier and Type
Field and Description
protected org.slf4j.Logger
logger
-
Constructor Summary
Constructors
Constructor and Description
SpincastUndertowWebsocketEndpointWriter(Map<String,io.undertow.websockets.core.WebSocketChannel> channels,
SpincastUndertowConfig spincastUndertowConfig)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
protected Map<String,io.undertow.websockets.core.WebSocketChannel>
getChannelsMap()
protected byte[]
getPingBytes()
protected SpincastUndertowConfig
getSpincastUndertowConfig()
void
sendClosingConnection(int closingCode,
String closingReason,
Set<String> peerIds,
ClosedEventSentCallback callback)
Sends a "closing connection" message to specified peers.
void
sendMessage(Set<String> peerIds,
byte[] bytes,
WebsocketPeersWriteCallback callback)
Sends a byte array message to specific
peers.
void
sendMessage(Set<String> peerIds,
String message,
WebsocketPeersWriteCallback callback)
Sends a String message to specific
peers.
void
sendPings(WebsocketPeersWriteCallback callback)
Sends a ping
message to all peers.
void
write(Set<String> peerIds,
SpincastUndertowWebsocketEndpointWriter.IWriteExecutor executor)
Calls the executor's write(...) method for each peers and, when all
asynchrounous calls are done, calls its writeErrors(...) with
the ids of the peers for which the write failed with an IOException.
-
-
Constructor Detail
-
SpincastUndertowWebsocketEndpointWriter
public SpincastUndertowWebsocketEndpointWriter(Map<String,io.undertow.websockets.core.WebSocketChannel> channels,
SpincastUndertowConfig spincastUndertowConfig)
Constructor
-
Method Detail
-
getSpincastUndertowConfig
protected SpincastUndertowConfig getSpincastUndertowConfig()
-
getPingBytes
protected byte[] getPingBytes()
-
sendPings
public void sendPings(WebsocketPeersWriteCallback callback)
Description copied from interface: UndertowWebsocketEndpointWriter
Sends a ping
message to all peers.
- Specified by:
sendPings
in interface UndertowWebsocketEndpointWriter
-
sendMessage
public void sendMessage(Set<String> peerIds,
String message,
WebsocketPeersWriteCallback callback)
Description copied from interface: UndertowWebsocketEndpointWriter
Sends a String message to specific
peers.
- Specified by:
sendMessage
in interface UndertowWebsocketEndpointWriter
-
sendMessage
public void sendMessage(Set<String> peerIds,
byte[] bytes,
WebsocketPeersWriteCallback callback)
Description copied from interface: UndertowWebsocketEndpointWriter
Sends a byte array message to specific
peers.
- Specified by:
sendMessage
in interface UndertowWebsocketEndpointWriter
-
sendClosingConnection
public void sendClosingConnection(int closingCode,
String closingReason,
Set<String> peerIds,
ClosedEventSentCallback callback)
Description copied from interface: UndertowWebsocketEndpointWriter
Sends a "closing connection" message to specified peers.
No exception thrown if the message can't be sent.
- Specified by:
sendClosingConnection
in interface UndertowWebsocketEndpointWriter
-
write
public void write(Set<String> peerIds,
SpincastUndertowWebsocketEndpointWriter.IWriteExecutor executor)
Calls the executor's write(...) method for each peers and, when all
asynchrounous calls are done, calls its writeErrors(...) with
the ids of the peers for which the write failed with an IOException.
Copyright © 2019. All rights reserved.