Class WebSocketChannel

java.lang.Object
com.inductiveautomation.ignition.common.websocket.WebSocketChannel

public final class WebSocketChannel extends Object
Encapsulates a WebSocket Session and logic to send messages conforming to the messaging protocol between the Gateway and the Designer / Vision Clients.
  • Constructor Details

    • WebSocketChannel

      public WebSocketChannel(org.eclipse.jetty.websocket.api.Session session)
      Create a new instance of WebSocketChannel
      Parameters:
      session - the Session bound to the new WebSocketChannel 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

      public void sendMessage(@NotNull @NotNull ByteBuffer message) throws WebSocketChannelException
      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 a ByteBuffer containing a serialized WebsocketProtoMessage.
      Throws:
      WebSocketChannelException - if there was a problem sending the message