RSocket is a binary protocol for use on byte stream transports such as TCP, WebSockets, and Aeron.
It enables the following symmetric interaction models via async message passing over a single connection:
It supports session resumption, to allow resuming long-lived streams across different transport connections. This is particularly useful for mobile⬄server communication when network connections drop, switch, and reconnect frequently.
Detailed information can be found in these documents:
Join the RSocket Community Forums to learn more about RSocket, get your RSocket questions answered, and interact with other RSocket developers.
Following is a brief example of a server and client in Java:
Example Java Server:
RSocketServer.create(new PingHandler()) .payloadDecoder(PayloadDecoder.ZERO) .bind(TcpServerTransport.create(7878)) .block() .onClose();
Example Java Client:
Mono<RSocket> client = RSocketConnector.create() .payloadDecoder(PayloadDecoder.ZERO) .transport(TcpClientTransport.create(7878)) .start(); PingClient pingClient = new PingClient(client); Recorder recorder = pingClient.startTracker(Duration.ofSeconds(1)); int count = 1_000; pingClient .startPingPong(count, recorder) .doOnTerminate(() -> System.out.println("Sent " + count + " messages.")) .blockLast();