Class JavaxWebSocketRemoteEndpoint

java.lang.Object
org.eclipse.jetty.websocket.javax.common.JavaxWebSocketRemoteEndpoint
All Implemented Interfaces:
javax.websocket.RemoteEndpoint, OutgoingFrames
Direct Known Subclasses:
JavaxWebSocketAsyncRemote, JavaxWebSocketBasicRemote

public class JavaxWebSocketRemoteEndpoint extends Object implements javax.websocket.RemoteEndpoint, OutgoingFrames
  • Field Details

    • session

      protected final JavaxWebSocketSession session
    • batch

      protected boolean batch
    • messageType

      protected byte messageType
  • Constructor Details

  • Method Details

    • newMessageWriter

      protected MessageWriter newMessageWriter()
    • newMessageOutputStream

      protected MessageOutputStream newMessageOutputStream()
    • flushBatch

      public void flushBatch() throws IOException
      Specified by:
      flushBatch in interface javax.websocket.RemoteEndpoint
      Throws:
      IOException
    • getBatchingAllowed

      public boolean getBatchingAllowed()
      Specified by:
      getBatchingAllowed in interface javax.websocket.RemoteEndpoint
    • setBatchingAllowed

      public void setBatchingAllowed(boolean allowed) throws IOException
      Specified by:
      setBatchingAllowed in interface javax.websocket.RemoteEndpoint
      Throws:
      IOException
    • getIdleTimeout

      public long getIdleTimeout()
    • setIdleTimeout

      public void setIdleTimeout(long ms)
    • getWriteTimeout

      public long getWriteTimeout()
    • setWriteTimeout

      public void setWriteTimeout(long ms)
    • sendFrame

      public void sendFrame(Frame frame, Callback callback, boolean batch)
      Description copied from interface: OutgoingFrames
      A frame, and optional callback, intended for the network layer.

      Note: the frame can undergo many transformations in the various layers and extensions present in the implementation.

      If you are implementing a mutation, you are obliged to handle the incoming WriteCallback appropriately.

      Specified by:
      sendFrame in interface OutgoingFrames
      Parameters:
      frame - the frame to eventually write to the network layer.
      callback - the callback to notify when the frame is written.
      batch - the batch mode requested by the sender.
    • sendObject

      public void sendObject(Object data, Callback callback) throws IOException, javax.websocket.EncodeException
      Throws:
      IOException
      javax.websocket.EncodeException
    • sendPing

      public void sendPing(ByteBuffer data) throws IOException, IllegalArgumentException
      Specified by:
      sendPing in interface javax.websocket.RemoteEndpoint
      Throws:
      IOException
      IllegalArgumentException
    • sendPong

      public void sendPong(ByteBuffer data) throws IOException, IllegalArgumentException
      Specified by:
      sendPong in interface javax.websocket.RemoteEndpoint
      Throws:
      IOException
      IllegalArgumentException
    • assertMessageNotNull

      protected void assertMessageNotNull(Object data)
    • assertSendHandlerNotNull

      protected void assertSendHandlerNotNull(javax.websocket.SendHandler handler)