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

net: move default address logic to _listen2 #539

Closed
wants to merge 1 commit into from

Conversation

vkurchatkin
Copy link
Contributor

When address is not provided to server.listen() _connectionKey and error messages should include actual address and correct family.

var net = require('net');

var s = net.createServer();

s.listen(3333)

console.log(s._connectionKey)

 s = net.createServer();
s.listen(3333)

Before:

4:null:3333
events.js:76
      throw er; // Unhandled 'error' event
            ^
Error: listen EADDRINUSE null:3333

After:

6::::3333
events.js:76
      throw er; // Unhandled 'error' event
            ^
Error: listen EADDRINUSE :::3333

R=@bnoordhuis?

@vkurchatkin
Copy link
Contributor Author

missed this: #239

/cc @JacksonTian and @cjihrig

But it seems to always report IPv4 address no matter what

@@ -68,6 +70,7 @@ server4.listen(common.PORT + 3, 127, function() {
process.on('exit', function() {
assert.ok(address0.port > 100);
assert.equal(common.PORT, address1.port);
assert.equal(connectionKey1, (address1.family === 'IPv6' ? '6::::' : '4:0.0.0.0:') + address1.port);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style: long line.

When address is not provided to `server.listen()`
`_connectionKey` and error messages should include
actual address and correct family.
@vkurchatkin
Copy link
Contributor Author

@bnoordhuis ping

bnoordhuis pushed a commit that referenced this pull request Jan 23, 2015
When address is not provided to `server.listen()`, `_connectionKey` and
error messages should include actual address and correct family.

PR-URL: #539
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@bnoordhuis
Copy link
Member

@vkurchatkin Sorry for the delay. Thanks, landed in 8de89ec!

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

Successfully merging this pull request may close these issues.

2 participants