1 year ago

#373391

test-img

spcmicro

RSocket-net - KEEPALIVE requests from the server are not being handled in the RSocket-net Client

I am trying to use the RSocket-net implementation of RSockets and have run across a problem.

The RSocket server can be setup to send KEEPALIVE frames at a rate specified in the RSocketOptions parameter passed to the ConnectAsync call on the RSocketClient. I am passing 2 seconds for the time, so I get KEEPALIVE frames from the server every 2 seconds as expected.

The incoming KEEP alive frames from the server hit a breakpoint in this block of code in RSocketProtocol.cs located in the RSocket-net code:

public KeepAlive(in Header header, ref SequenceReader<byte> reader)
{
Header = header;

reader.TryRead(out long lastReceivedPosition);
LastReceivedPosition = lastReceivedPosition;

TryReadRemaining(header, InnerLength, ref reader, out _, out DataLength);
}

The message is consumed at this point but there is no response back to the server, and the server times out after 30 seconds of no responses. I have run the RSocket-java version of the RSocket code and it responds as expected and the server keeps the connection open.

I think this is something that was missed in the .net version and to fix the problem, I think a response for this frame type needs to be added to the RSocketProtocol.cs code. I am ready to dive into the code and work on the problem, but I wanted to check with other developers that have more experience with the code and could help me to make these changes in a way that properly follows the protocol and doesn't negatively affect the existing code.

I expected the RSocket-net library to handle the KEEPALIVE frames from the server.

keep-alive

rsocket

0 Answers

Your Answer

Accepted video resources