Class PartialByteBufferMessageSink

java.lang.Object
org.eclipse.jetty.websocket.core.messages.AbstractMessageSink
org.eclipse.jetty.websocket.core.messages.PartialByteBufferMessageSink
All Implemented Interfaces:
MessageSink
Direct Known Subclasses:
PartialByteBufferMessageSink

public class PartialByteBufferMessageSink extends AbstractMessageSink

A MessageSink implementation that delivers BINARY frames to the application function passed to the constructor in the form of a ByteBuffer.

  • Constructor Details

    • PartialByteBufferMessageSink

      public PartialByteBufferMessageSink(CoreSession session, MethodHandle methodHandle, boolean autoDemand)
      Parameters:
      session - the WebSocket session
      methodHandle - the application function to invoke when a new frame has arrived
      autoDemand - whether this MessageSink manages demand automatically
  • Method Details

    • accept

      public void accept(Frame frame, Callback callback)
      Description copied from interface: MessageSink

      Consumes the WebSocket frame, possibly asynchronously when this method has returned.

      The callback argument must be completed when the frame payload is consumed.

      The demand for more frames must be explicitly invoked, or arranged to be invoked asynchronously, by the implementation of this method, by calling CoreSession.demand().

      Parameters:
      frame - the frame to consume
      callback - the callback to complete when the frame is consumed
    • invoke

      protected void invoke(MethodHandle methodHandle, ByteBuffer byteBuffer, boolean fin, Callback callback) throws Throwable
      Throws:
      Throwable