-
-
Notifications
You must be signed in to change notification settings - Fork 35.7k
socket.server is not defined #5083
Copy link
Copy link
Closed
Labels
httpsIssues or PRs related to the https subsystem.Issues or PRs related to the https subsystem.netIssues and PRs related to the net subsystem.Issues and PRs related to the net subsystem.
Description
Metadata
Metadata
Assignees
Labels
httpsIssues or PRs related to the https subsystem.Issues or PRs related to the https subsystem.netIssues and PRs related to the net subsystem.Issues and PRs related to the net subsystem.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Recently myself and @braydonf were upgrading a project from 0.10.28 to 4.x and found something our connection tracking logic broke and was causing our server to never shutdown. When investigating I found that the server would never emit the close event even if all sockets had been destroyed.
When looking at net.js I noticed that the server._emitCloseIfDrained won't be called if the connection is missing its
serverproperty:https://github.com/nodejs/node/blob/v4.2.6/lib/net.js#L482
I decided to check for this property when creating my server
I found that in 0.10.x
socket.serverwas defined, but in 4.x it was undefined. I tried to make a test case to replicate it but found I was unable to do so. Luckily @braydonf took another look at it and has managed to replicate it, and is currently tracking down exactly when breakage occurred and said he would follow up on this issue when found. Looks like so far he's narrowed it down to io.js2.2->2.3.