Package org.atmosphere.webtransport
Interface WebTransportHandler
- All Known Implementing Classes:
WebTransportHandlerAdapter,WebTransportProcessor.WebTransportHandlerProxy
public interface WebTransportHandler
Application-level handler for WebTransport sessions. Mirrors the
WebSocketHandler contract for WebTransport
over HTTP/3.-
Method Summary
Modifier and TypeMethodDescriptionvoidonByteMessage(WebTransportSession session, byte[] data, int offset, int length) Invoked when a binary message is received on the bidirectional stream.voidonClose(WebTransportSession session) Invoked when a WebTransport session is closed.voidInvoked when a WebTransport session encounters an error.voidonOpen(WebTransportSession session) Invoked when a WebTransport session is opened.voidonTextMessage(WebTransportSession session, String data) Invoked when a text message is received on the bidirectional stream.
-
Method Details
-
onByteMessage
void onByteMessage(WebTransportSession session, byte[] data, int offset, int length) throws IOException Invoked when a binary message is received on the bidirectional stream.- Parameters:
session- theWebTransportSessiondata- the raw bytesoffset- start offsetlength- number of bytes- Throws:
IOException
-
onTextMessage
Invoked when a text message is received on the bidirectional stream.- Parameters:
session- theWebTransportSessiondata- the decoded text- Throws:
IOException
-
onOpen
Invoked when a WebTransport session is opened.- Parameters:
session- theWebTransportSession- Throws:
IOException
-
onClose
Invoked when a WebTransport session is closed.- Parameters:
session- theWebTransportSession
-
onError
Invoked when a WebTransport session encounters an error.- Parameters:
session- theWebTransportSessiont- the exception
-