Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port Bridge Question #49

Open
nicksav opened this issue Jan 8, 2020 · 6 comments
Open

Port Bridge Question #49

nicksav opened this issue Jan 8, 2020 · 6 comments

Comments

@nicksav
Copy link

nicksav commented Jan 8, 2020

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
image

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:
image
As you can see, the connection worked 2 times, and then for some reason it just dispose it and the app crashed.

@dlstucki
Copy link
Contributor

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.

@dlstucki
Copy link
Contributor

dlstucki commented Jan 13, 2020

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..

@dlstucki
Copy link
Contributor

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 #50

@jfggdl
Copy link

jfggdl commented Feb 3, 2020

@nicksav Do you still have issues once you integrated PR #50?

@nicksav
Copy link
Author

nicksav commented Feb 3, 2020

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.

@Splaxi
Copy link

Splaxi commented May 24, 2020

@nicksav

How did it go with the fix and .net core?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants