You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes to TCP/WS Framing (committing to length-only (no EoM) so that the transport doesn't have to deal with multiple frames in a stream and reframing them. Fixes to server-side wiring of protocol handling to enable bi-directional server calls (untested yet). New RPC generated classes and helper base class (in-progress). EchoService as first prototype in RPC Sample.
voidIRSocketProtocol.Setup(inRSocketProtocol.Setupvalue)=>thrownewInvalidOperationException($"Client cannot process Setup frames");
135
-
voidIRSocketProtocol.RequestStream(inRSocketProtocol.RequestStreammessage)=>thrownewNotImplementedException();//TODO How to handle unexpected messagess...
voidIRSocketProtocol.RequestStream(inRSocketProtocol.RequestStreammessage,ReadOnlySequence<byte>metadata,ReadOnlySequence<byte>data)=>thrownewNotImplementedException();//TODO How to handle unexpected messagess...
@@ -31,12 +33,13 @@ static public async Task Handler(IRSocketProtocol sink, PipeReader pipereader, C
31
33
varposition=buffer.Start;
32
34
33
35
//Due to the nature of Pipelines as simple binary pipes, all Transport adapters assemble a standard message frame whether or not the underlying transport signals length, EoM, etc.
if(buffer.Length<framelength){pipereader.AdvanceTo(buffer.Start,buffer.End);continue;}//Don't have a complete message yet. Tell the pipe that we've evaluated up to the current buffer end, but cannot yet consume it.
if(buffer.Length<Length+MESSAGEFRAMESIZE){pipereader.AdvanceTo(buffer.Start,buffer.End);continue;}//Don't have a complete message yet. Tell the pipe that we've evaluated up to the current buffer end, but cannot yet consume it.
//TODO - this should work now too!!! Need to evaluate if there is more than one packet in the pipe including edges like part of the length bytes are there but not all.
@@ -444,32 +447,32 @@ static public async Task Handler(IRSocketProtocol sink, PipeReader pipereader, C
444
447
// else { throw new InvalidOperationException(); } //This is impossible, since we had at least one byte...
445
448
//}
446
449
447
-
//static bool TryReadInt24BigEndian(ReadOnlySequence<byte> buffer, ref SequencePosition position, out Int32 value)
448
-
//{
449
-
// const int SIZEOF = 3;
450
-
// buffer = buffer.Slice(position, SIZEOF);
451
-
// if (buffer.TryGet(ref position, out var memory)) //TODO is this better as IsSingleSegment or unrolled loop or even read 4 bytes and if (BinaryPrimitives.TryReadInt32BigEndian(span, out var result) { value = result & 0xFFFFFF; }
if(buffer.TryGet(refposition,outvarmemory))//TODO is this better as IsSingleSegment or unrolled loop or even read 4 bytes and if (BinaryPrimitives.TryReadInt32BigEndian(span, out var result) { value = result & 0xFFFFFF; }
0 commit comments