An implementation of RSocket for .NET.
rsocket / rsocket-net Goto Github PK
View Code? Open in Web Editor NEW.NET implementation of RSocket
License: Apache License 2.0
.NET implementation of RSocket
License: Apache License 2.0
As for now, it seems not to be possible to use rsocket-net from inside Unity3D project.
RSocket seems like an ideal solution for some kind of multiplayer games (turn-based, some casual networking games). Game DEV industry might be an area for potential growth and adoption.
I created a multiplayer, turned-based game for Android and so I tried to use RSocket as it seemed the most appropriate solution for my needs. I tried gRPC, Websockets, SocketIO etc. and ended up with SocketIO, but I still regret not investing time for making RSocket.NET run on my project somehow.
It would be great if the library would be supported for all platform like WebGL, Android, IOS, consoles, PC.
I know RSocket is transport-transparent by design and it would make potential rsocket-unity3d project easier to implement (ie. WebGL supports only Websockets). The more significant problem (potentially) would be to make it Android compatible (AOT issues).
So, in a nutshell, the desired solution would be to create a separate project that would use only Unity3D compatible libraries and would support both Android and WebGL (as AFAIK only these platforms cause problems).
I am not sure, but it may be possible to modify rsocket-net project so that it could be ran on Unity3D.
Hello :)
I would like to know how to route to a specific message mapping using routes.
I have a spring boot server using RSocket over tcp and this code
server.port=8080
spring.rsocket.server.port=8081
spring.rsocket.server.transport=tcp
@MessageMapping("feedMarketData")
public Flux<MarketData> feedMarketData(MarketDataRequest marketDataRequest) {
return marketDataRepository.getAll(marketDataRequest.getStock());
}
I Would like to make a .NET request routing to feedMarketData
Thanks for your help !
Hi, I made some changes to rsocket.net, it supports back pressure and cancel operations now. I'll continue to develop other features next. Can I synchronize my changes to the main branch?
My fork: https://github.com/shuxinqin/rsocket-net
@OlegDokuka , we observed that a new version 1.0.0 was available from nuget on 23rd july 2020
It was observed that few classes and interface available in 0.2.3 are not available in the new version
For ex: IRSocketChannel and RSocketOptions are not longer available
From yesterdays code merge and discussion done with Reetesh Agarwal's team ,we were expecting that the same changes would be available related to PR #11
Some of the interfaces and classes are no longer available and code seems to contain few different method and classes.
Please confirm if its from the same source and 1.0.0 is the intended version to be used.
Source Link intro: https://docs.microsoft.com/en-us/dotnet/standard/library-guidance/sourcelink
Maybe I miss something, but how to handle FireAndForget
request?
For Request/Response
, Request/Channel
and Request/Stream
we have Funcs Responder
, Channeler
and Streamer
or methods Stream
, Respond
and Channel
, but for FireAndForget
we have only trigger method RequestFireAndForget
.
Is this being worked on? With the new System.IO.Pipelines API this would be fantastic for .NET Core microservices.
If nobody's working on it I might have a hack at it.
rsocket-net/RSocket.Core/RSocketProtocol.Handler.cs
Lines 28 to 42 in 1960d65
Doesn't properly handle the exit condition and could result in an infinite loop if partial data is sent and the read is completed.
See https://github.com/davidfowl/DocsStaging/blob/master/Pipelines.md#code-samples for more information.
During the RSocketClient initialisation, I have defined the Responder as Follows:
public async ValueTask<(ReadOnlySequence Data, ReadOnlySequence Metadata)> RequestReponseListner((ReadOnlySequence data, ReadOnlySequence metadata) value)
What i observe is that, the data gets truncated beyond ~1800 bytes.
Would you please consider resurrecting this project and give the (relatively speaking) new .NET Core ecosystem another chance?
I might be late to the party, but rsocket sounds very interesting, especially for people like me looking for new ways to solve recurring problems with better tools.
There’s a month-old PR by @davidfowl that went unnoticed.
I think that was a missed opportunity.
For anyone else lurking here, any “rsocket equivalent” tech you’d recommend for .NET Core 3?
Thanks
Strong name signing will encourage more users to use the RSocket core library so that it can be used by projects which use strong name signing
Create a strong name key and sign the RSocket core dll
Tried signing locally but due to virality of strong name signing it requires properly signed dlls.
Steps:
The logging on every call takes a lot of time. Doing 10,000 request responses of static text "OK" takes 1.8426/ms per request which is abysmal for a 2 byte package. I see no clear options to disable this. If there is already a way to disable please let me know.
Ability to turn off logging
No ability to turn off logging (that I can see)
Follow the demo project, echo OK for 10,000 iterations
@Test
public void reproCase() {
}
Provide ability to disable logging
netty
, ...):javar -version
) or Node version (node --version
)):uname -a
):@OlegDokuka currently version 0.2.3 is not digitally signed.
Based on discussion done with Reetesh Agarwal's, we were expecting the digitally signed versions to be available in some time .
Any idea when we can expect the package to be signed with valid certificates.
Currently in the RSocket Library we don't have a mechanism to handle errors coming from server.
I also observed that the observer is not being removed from the Dispatcher map used internally.
This will increase memory over time is my belief.
The streamId used to push to Dispatcher map is also int and will overflow over time and should fail in the long run. Correct me if I am wrong on this.
I have copied the screenshots below for reference,
We should get the OnError callback for System.IObserver<(System.Buffers.ReadOnlySequence metadata, System.Buffers.ReadOnlySequence data)> object that is passed in our case RequestReponse function.
The object must be disposed from the Dispatcher map once there is no further reference to it.
We must reuse streamid so that it will work infinitely.
No callback in case of an error from the server
1.Send a RequestResponse to a server and let the server respond back with some error
@test
public void reproCase() {
}
## Possible Solution
<!--- Not obligatory, but you can suggest a fix/reason for the bug. -->
## Your Environment
<!--- Include as many relevant details about the environment you experienced the bug in. -->
<!--- Especially, always include the version(s) of RSocket library/libraries you used! -->
* RSocket version(s) used:
* Other relevant libraries versions (eg. `netty`, ...):
* Platform (eg. JVM version (`javar -version`) or Node version (`node --version`)):
* OS and version (eg `uname -a`):
Per this SO for a net client (with either binary or string data encoding) the 1st message is received and treated properly and usually the 2nd but from then on messages are truncated. This causes a crash at RSocketProtocol.Handler.cs where the header type is unknown and therefore not handled.
To replicate the error start a Java spring boot RSocket server. Then spin up a net client with code like this:
var client = new RSocketClient(new WebSocketTransport("ws://127.0.0.1:7000/"));
Console.WriteLine("Connect Async");
await client.ConnectAsync(new RSocketOptions()
{
DataMimeType = "application/json",
MetadataMimeType = "message/x.rsocket.routing.v0"
});
Console.WriteLine("Requesting Raw Stream...");
string json = "{\"StartServerStream\":\"Y\"}";
string route = "quotes";
byte[] intBytes = BitConverter.GetBytes(6);
string stringBytes = Encoding.Default.GetString(intBytes, 0, 1);
string metaData = stringBytes + route;
var stringclient = new RSocketClient.ForStrings(client);
await stringclient.RequestStream(json, metaData)
.ForEachAsync((result) =>
{
Console.WriteLine($"Result ===> {result}");
});
The server uses webflux
to stream back to the client. Get the RSocket.Core and put a breakpoint at https://github.com/rsocket/rsocket-net/blob/master/RSocket.Core/RSocketProtocol.Handler.cs#L30
If you watch the message sizes coming in, the 1st message size is what you expect from your server (fielding dummy messages) but the next message sizes are unexpected.
The client of websocket in this repository cannot work properly, as websocket don't have frame length.
So if you want to use rsocket with websocket, try this.
Hi RSocket Team,
I am trying to create a very simple RSocketServer using .NET 5. I have seen the sample project RSocketSample and tried to replace LoopbackTransport with SocketTransport or WebSocketTransport. I have used .NET 5 worker template and put this logic to separate hosted service. But it does not work. Sample with SocketTransport falls at Server.ConnectAsync(), but WebSocketTransport sample starts normally. However, I cannot connect it through WebSocket - Chrome says "WebSocket connection failed" when I try to do let ws = new WebSocket('ws://localhost:59800') (I am using this port in server app). Could you please add samples of SocketTransport & WebSocketTransport use?
Thanks,
Alex
Hi everyone,
I have a Spring Boot RSocket server and I am unable to connect to it with your example. I got a rejected Setup :
0000 Error {000}: [00000003] Invalid mime type "binary": does not contain '/'
I tried some options in RSocketOptions but alyaws the same error
Here is my spring server config :
spring:
rsocket:
server:
port: 7000
transport: tcp
Here is my dotnet program
var client = new RSocketClient(new SocketTransport("tcp://localhost:7000"), new RSocketOptions(){ InitialRequestSize = 3 });
//var client = new RSocketClient(new WebSocketTransport("ws://localhost:9092/"), new RSocketOptions() { InitialRequestSize = 3 });
//var client = new RSocketClient(loopback);
await client.ConnectAsync();
The server is working, I did manage to handle RSocket data with another spring boot client.
Thanks for your help !
On setting up the RSocket connection with options ( 10 seconds KeepAlive and 180 seconds LifeTime) the connection is getting closed on the .NET client side as server is not receiving any heartbeat messages.
The issue is not replicated in Java RSocket client Library.
@OlegDokuka Can you please look into this with priority as we are blocked because of this issue.
Does this library support secure (tls) connections over the TCP connections? For WebSockets it works by using wss
scheme URL but what about tcp?
I want to add routing and specify how to operate MIME and headers in metadata, and ensure that the Java server receives this content correctly. I would like an example code
Hello, is this project still under maintenance?
While I was looking implementation in C# using RSocket.Core, package was listing on Nuget. But today i see "The owner has unlisted this package. This could mean that the package is deprecated or shouldn't be used anymore" message.
What is the feature of this package ? Should i wait for a new version or not consider this solution for RSocket .Net implementation ?
The SocketTransport is configured as a 'client' socket with no specific bind and / or listen so although it exists it doesn't appear possible to actually connect to anything.
Is this work in progress or is there a specific usage pattern than I am missing ? It seems that each separate service would require a 'server' SocketTransport to handle incoming connections and then this existing implementation to call out to other services.
Thanks for any help, fingers crossed the project hasn't ground to a halt
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.