Class WebSocketChannel
java.lang.Object
com.inductiveautomation.ignition.common.websocket.WebSocketChannel
Encapsulates a WebSocket Session and logic to send messages conforming to the messaging protocol between the Gateway
and the Designer / Vision Clients.
-
Constructor Summary
ConstructorsConstructorDescriptionWebSocketChannel
(org.eclipse.jetty.websocket.api.Session session) Create a new instance ofWebSocketChannel
-
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.jetty.websocket.api.Session
void
sendMessage
(@NotNull ByteBuffer message) Send a message to the remote endpoint.
-
Constructor Details
-
WebSocketChannel
public WebSocketChannel(org.eclipse.jetty.websocket.api.Session session) Create a new instance ofWebSocketChannel
- Parameters:
session
- theSession
bound to the newWebSocketChannel
instance. must not be null.- Throws:
NullPointerException
- if the given session argument is null
-
-
Method Details
-
getSession
public org.eclipse.jetty.websocket.api.Session getSession()- Returns:
- the currently active
Session
for the open WebSocket connection
-
sendMessage
Send a message to the remote endpoint. All messages must be sent through this method to guarantee protocol correctness.- Parameters:
message
- the message to send, which must be aByteBuffer
containing a serializedWebsocketProtoMessage
.- Throws:
WebSocketChannelException
- if there was a problem sending the message
-