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.
The newest version!
SpincastUndertowWebsocketEndpointWriter (org.spincast:spincast-framework 0.9.28 API)
org.spincast.plugins.undertow
Class SpincastUndertowWebsocketEndpointWriter
- java.lang.Object
-
- org.spincast.plugins.undertow.SpincastUndertowWebsocketEndpointWriter
-
- All Implemented Interfaces:
- IUndertowWebsocketEndpointWriter
public class SpincastUndertowWebsocketEndpointWriter
extends Object
implements IUndertowWebsocketEndpointWriter
-
-
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,
ISpincastUndertowConfig 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 ISpincastUndertowConfig
getSpincastUndertowConfig()
void
sendClosingConnection(int closingCode,
String closingReason,
Set<String> peerIds,
IClosedEventSentCallback callback)
Sends a "closing connection" message to specified peers.
void
sendMessage(Set<String> peerIds,
byte[] bytes,
IWebsocketPeersWriteCallback callback)
Sends a byte array message to specific
peers.
void
sendMessage(Set<String> peerIds,
String message,
IWebsocketPeersWriteCallback callback)
Sends a String message to specific
peers.
void
sendPings(IWebsocketPeersWriteCallback 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,
ISpincastUndertowConfig spincastUndertowConfig)
Constructor
-
Method Detail
-
getSpincastUndertowConfig
protected ISpincastUndertowConfig getSpincastUndertowConfig()
-
getPingBytes
protected byte[] getPingBytes()
-
sendPings
public void sendPings(IWebsocketPeersWriteCallback callback)
Description copied from interface: IUndertowWebsocketEndpointWriter
Sends a ping message to all peers.
- Specified by:
sendPings in interface IUndertowWebsocketEndpointWriter
-
sendMessage
public void sendMessage(Set<String> peerIds,
String message,
IWebsocketPeersWriteCallback callback)
Description copied from interface: IUndertowWebsocketEndpointWriter
Sends a String message to specific
peers.
- Specified by:
sendMessage in interface IUndertowWebsocketEndpointWriter
-
sendMessage
public void sendMessage(Set<String> peerIds,
byte[] bytes,
IWebsocketPeersWriteCallback callback)
Description copied from interface: IUndertowWebsocketEndpointWriter
Sends a byte array message to specific
peers.
- Specified by:
sendMessage in interface IUndertowWebsocketEndpointWriter
-
sendClosingConnection
public void sendClosingConnection(int closingCode,
String closingReason,
Set<String> peerIds,
IClosedEventSentCallback callback)
Description copied from interface: IUndertowWebsocketEndpointWriter
Sends a "closing connection" message to specified peers.
No exception thrown if the message can't be sent.
- Specified by:
sendClosingConnection in interface IUndertowWebsocketEndpointWriter
-
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 © 2016. All rights reserved.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy