azure-relay
azure-relay copied to clipboard
Port Bridge Question
Looks like another dying Microsoft project.... Was good start and then no updates, no migration to .net core, nothing...
Anyway, may be someone look at this enough and have some ideas.
The code inside: MultiplexConnectionInputPump
I am getting exception when shutdownConnection = true, but stopped is not actually true. So, the code closes the connection, but still trying to read data from connection.
There is a very interesting line: bool shutdownConnection = (frameSize == 0); What is frameSize means and why haveing it == 0 will shutdown the connection?
I have put a lot of logs to see what's happening:
This is from Server Agent side:
As you can see, the connection worked 2 times, and then for some reason it just dispose it and the app crashed.
Your unhandled exception is when a method, MultiplexedConnectionOutputPump.RunThis
, throws. I can't find any RunThis method, did you add it? If so, it needs to handle exceptions to avoid the process crashing.
This sample has multiplexing, meaning multiple logical connections over one single 'physical' connection (a connected HybridConnectionStream). Each payload sent over the wire has a frame indicating the logical connection id, the length of data in that frame, then that data. When a frame comes for a connection (identified by ID) and the length of the frame is 0 that's a special signal to the multiplexing layer to close the logical connection. That's why shutdownConnection = (frameSize == 0) can be true, meaning close the logical connection, but the overall HybridConnectionStream is still opened/connected..
I started looking into the PortBridge sample a bit and found some issues which could lead to errors and even data out of order. Please upgrade to include the fixes in PR https://github.com/Azure/azure-relay/pull/50
@nicksav Do you still have issues once you integrated PR #50?
Hey guys
Haven't checked it yet. I managed to convert to .net core 3. And it works fine, except it is not reliable for long running things, like long SQL query. I will try to add your fix into .net core 3 project and see if that helps.
@nicksav
How did it go with the fix and .net core?