-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
The allowHalfOpen
doesn't seem to be working on the server
#41
Comments
Sounds like a bug, we only use halfOpen mode so prob why we haven't noticed then. Can you PR a test case, then we'll get it fixed. |
Ok I have discovered a strange situation. The If the |
So to get the behaviour I'm lookign for:
It just seems that But the fact that I also need a |
Yea that's a stream mechanic. In only goes into flowing mode once you either pipe it, attach a data handler or call resume. That's the same with any node stream |
I had no idea that this would have a side-effect:
That seems quite confusing. That without attaching a data handler, no |
Yes, see my above comment, that's how node.js streams work. |
I don't think this is actually resolved. I haven't submitted a PR for this problem. |
👍👌 |
I found that in the code, the const utpSocket = UTP.createServer(
{
allowHalfOpen: false,
},
this.handleConnection
); While this means that When you get the utp connection inside I've also found that if you try to |
I've created a server like:
Using the
allowHalfOpen
I'm expecting that theutpConn
would be closed if the remote side has sent anend
event. That is they closed their write side, ending my read side. Therefore I should have an automatic close of my write side, and that should trigger a close event.However that's not what is happening. Instead I get a UTPCONNRESET error.
To actually ensure that my side is being closed if this occurs, I have to attach my own event handler to the
end
:Only then does the connection actually close.
The text was updated successfully, but these errors were encountered: