-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
'end' event not called on connected socket wrapped with tls #10871
Comments
*I'm not sure if this is related because the in this piece of code, the 'end' event is also not emitted if we hit CTRL^C on the Client side: const server = require('net').createServer((socket)=>{
var interval = setInterval(()=>{ socket.write("hello socket"); }, 10);
socket.on('end', ()=>{ console.log('end'); });
socket.on('close', ()=>{ console.log('close'); clearInterval(interval); });
socket.on('error', (error)=>{ console.log(error); });
}).listen(9999); then on a shell do: if we don't hit |
@nodejs/crypto @nodejs/http |
I'm having the same problem with node 8.9.4 |
According to the code here: Lines 312 to 315 in 097896b
A The problem is that a socket not wrapped in |
Personally, for anyone has the same problem, directly use |
@ronag ... this may be one that interests you. It could be this is already fixed but not likely, but it falls in line with making all the streams things work consistently. |
I will take a look. |
It's still a problem. Or at least it still seems to behave in the same way as when OP created issue. |
I'm actually more surprised that end is emitted in one of the cases. |
@jasnell: I find that 'end' makes very little sense for sockets at the moment, since we don't really have a graceful vs non-graceful connection disconnect. So whether an when Would be interesting to understand why there is a difference between OP's examples and why they differ. However, not sure what to do what that information. At the moment I would recommend not using Refs: #31916 |
This caused the reference counts to not be zero when we'd go to clear the cache in `clearPendingUploads`. Bug introduced in the nightly build, but didn't have any negative impact except printing an error in the logs because of the unhandled promise rejection. Ref: nodejs/node#10871 (comment)
When wrapping an existing socket with tls, the socket's 'end' event is not called if the socket was already connected.
Example:
In this case 'end' will be called:
In this case 'end' will not be called:
The text was updated successfully, but these errors were encountered: