{"action":"opened","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/6190","repository_url":"https://api.github.com/repos/nodejs/node","labels_url":"https://api.github.com/repos/nodejs/node/issues/6190/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/6190/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/6190/events","html_url":"https://github.com/nodejs/node/issues/6190","id":148208989,"number":6190,"title":"net: multiple listen() events fail silently","user":{"login":"trevnorris","id":289174,"avatar_url":"https://avatars.githubusercontent.com/u/289174?v=3","gravatar_id":"","url":"https://api.github.com/users/trevnorris","html_url":"https://github.com/trevnorris","followers_url":"https://api.github.com/users/trevnorris/followers","following_url":"https://api.github.com/users/trevnorris/following{/other_user}","gists_url":"https://api.github.com/users/trevnorris/gists{/gist_id}","starred_url":"https://api.github.com/users/trevnorris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trevnorris/subscriptions","organizations_url":"https://api.github.com/users/trevnorris/orgs","repos_url":"https://api.github.com/users/trevnorris/repos","events_url":"https://api.github.com/users/trevnorris/events{/privacy}","received_events_url":"https://api.github.com/users/trevnorris/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nodejs/node/labels/good%20first%20contribution","name":"good first contribution","color":"bfdadc"},{"url":"https://api.github.com/repos/nodejs/node/labels/net","name":"net","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-13T23:17:48Z","updated_at":"2016-04-13T23:17:48Z","closed_at":null,"body":"* **Version**: >= v4.x\r\n* **Platform**: All\r\n* **Subsystem**: net\r\n\r\nIt's possible to run `listen()` on a `net.Server` that's already listening to a port. The result is silent failure, with the side effect of changing the `_connectionKey` and or `_pipeName`.\r\n\r\nMore expected behavior would be to emit an error on the server's `'error'` event handler.\r\n\r\nExample test:\r\n```js\r\nconst assert = require('assert');\r\nconst net = require('net');\r\nconst server = net.createServer();\r\nserver.on('error', () => {\r\n  process._rawDebug('server had an error');\r\n});\r\nserver.listen(8080).listen(8081);\r\nprocess.on('exit', () => {\r\n  assert.equal(server.address().port, 8080);\r\n  const key = server._connectionKey;\r\n  assert.equal(key.substr(key.lastIndexOf(':')), ':8080');\r\n});\r\n```"}}