Top Description Methods
org.glassfish.tyrus.spi

public Interface ReadHandler

Imports
java.nio.ByteBuffer

Read handler provides a way for a transport to pass websocket connection data to tyrus runtime. A transport reads websocket data for an connection and passes the data to tyrus runtime for invoking endpoint.

An implementation of this interface is created by tyrus runtime. Once a transport completes a successful upgrade for a connection, the transport can get hold of the handler using Connection#getReadHandler().

Method Summary

Modifier and TypeMethod and Description
public void
handle(ByteBuffer
websocket data of a connection.
data
)

A transport reads websocket data and invokes this method to handover websocket data for a connection to tyrus runtime.

Method Detail

handleback to summary
public void handle(ByteBuffer data)

A transport reads websocket data and invokes this method to handover websocket data for a connection to tyrus runtime. The runtime consumes as much data as possible from the byte buffer. If there is some remaining data in the buffer, transport needs pass those bytes in more call (along with more data) in the same byte buffer or in a newer byte buffer.

Parameters
data:ByteBuffer

websocket data of a connection.