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

No callbacks when closing sockets #7916

Closed
svencan opened this issue Jul 29, 2016 · 4 comments
Closed

No callbacks when closing sockets #7916

svencan opened this issue Jul 29, 2016 · 4 comments
Labels
dgram Issues and PRs related to the dgram subsystem / UDP. invalid Issues and PRs that are invalid.

Comments

@svencan
Copy link

svencan commented Jul 29, 2016

  • Version: 6.3.1
  • Platform: Linux 14.04.1-Ubuntu SMP Tue Jun 28 19:17:10 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem: dgram

I think the following issue is dgram related, not node-upnp-utils related.

futomi/node-upnp-utils#1

@ChALkeR
Copy link
Member

ChALkeR commented Jul 29, 2016

I think the following issue is dgram related, not node-upnp-utils related.

Could you create a testcase that does not require any thirdparty modules?

@claudiorodriguez claudiorodriguez added the dgram Issues and PRs related to the dgram subsystem / UDP. label Jul 29, 2016
@imyller
Copy link
Member

imyller commented Aug 1, 2016

Just tested following code on all major versions of Node.js from old 0.8 to latest 6.3.1:

var dgram = require('dgram');
var server = dgram.createSocket('udp4');

server.on('listening', function () {
    var address = server.address();
    console.log('server listening: ' + address.address + ':' + address.port);
});

server.on('close', function () {
    console.log('server closed (event)');
});

server.bind(41234);

setTimeout(function () {
    server.close( function() {
        console.log('server closed (callback)');
    });
}, 1000);

Output with Node.js version >= 4:

$ node dgram_test.js 
server listening: 0.0.0.0:41234
server closed (event)
server closed (callback)

Output with Node.js version <= 0.12:

$ node dgram_test.js 
server listening: 0.0.0.0:41234
server closed (event)

This expected behaviour matches the API documentation for each version:

https://nodejs.org/docs/latest-v0.12.x/api/dgram.html#dgram_socket_close
https://nodejs.org/api/dgram.html#dgram_socket_close_callback

I think this issue can be closed.

@ChALkeR
Copy link
Member

ChALkeR commented Aug 1, 2016

This ticket

Version: 6.3.1

Ticket you linked to:

I have a Cordova project with JXCore using this node module.

@svencan Are you sure that you are running Node.js 6.3.1?

@ChALkeR
Copy link
Member

ChALkeR commented Aug 1, 2016

Ok, no way to reproduce atm, not clear what the actual issue is, and the description mentions that JXCore is being used instead of Node.js. I'm closing this for now, feel free to reopen if it is an issue that could be reproduced in recent Node.js versions.

@ChALkeR ChALkeR closed this as completed Aug 1, 2016
@ChALkeR ChALkeR added the invalid Issues and PRs that are invalid. label Aug 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dgram Issues and PRs related to the dgram subsystem / UDP. invalid Issues and PRs that are invalid.
Projects
None yet
Development

No branches or pull requests

4 participants