RSocketServer is the high level abstraction leveraged to create a server running the RSocket protocol.
RSocketServer server can be used to communicate with any RSocket Client implemented against the same protocol version as the server, and which implements the same transport as the server.
To get started creating an RSocket server, you will first need to install the
rsocket-core NPM package, and atleast one transport protocol implementation. See the server portion of WebSocket Client Server Example for an example of an implemented
A transport is the abstraction which handles the underlying network communication portion of the RSocket applicaiton protocol.
Available network transports for
When creating a
RSocketServer instance, the constructor options require a function (
getRequestHandler) to be provided that can return an object matching the
Responder interface. This object is responsible for mapping callback/handler functions to the various RSocket message types, and returning an appropriate
rsocket-flowable that will produce/injest data for the request.
An important characteristic of RSocket's protocol is the concept of cancellation.
In the context of an RSocket server, once a client connection/request has begun, it is possible that the client which initiated the request may decide it no longer wishes to continue and signal to the server that it wishes to cancel.
In the event that a client signals to an RSocket server that it wishes to cancel a request, the server should avoid calling the
onNext callbacks for the requests resulting