Search code examples
websocketrsocketaeron

What is the difference between RSocket + TCP and RSocket + WebSocket?


I am completely new to RSocket.

I read the FAQ and the motiviations page (and skimmed the Protocol page) and understand that RSocket can be used on top of TCP, WebSocket and Aeron. But what I don't understand is what the differences are between using RSocket with these transports because all interaction-models can be used with each transport.

I am personally interested in using RSocket channel to enable bi-directional communication but don't know which transport I should use. For example what are the differences between RSocket (channel) + TCP and RSocket (channel) + WebSocket?

I couldn't find an answer anywhere, so I was hoping someone here could help me out.

Ty in advance.


Solution

  • RSocket let's you program across platforms (JS, iOS, Android, C++ Server) with a single reactive network programming model. Cleanly supporting common reactive operations from frameworks like RxJava (Observable, Flowable, Single, Maybe, Completable).

    The underlying transport is an implementation detail. But it's a critical implementation detail as between a mobile and a server hosted in GCP, WebSocket may be the only viable option. While in a datacenter you may opt for Aeron or TCP depending on your requirements.

    Whatever you choose, you can write against the same higher level model of reactive network operations. If you know you just need say Aeron for a single server to server operation, you may not need RSocket, you could program directly against Aeron. RSocket is giving you this abstraction above it.