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

PendingPacket keeps going after client.close() #2

Open
mvayngrib opened this issue Apr 29, 2015 · 0 comments
Open

PendingPacket keeps going after client.close() #2

mvayngrib opened this issue Apr 29, 2015 · 0 comments

Comments

@mvayngrib
Copy link
Contributor

thanks for the great lib!

here's the breaking test:

var rudp = require('rudp');
var dgram = require('dgram');

var billSocket = dgram.createSocket('udp4');
var tedSocket = dgram.createSocket('udp4');
billSocket.bind(function() {
  tedSocket.bind(function() {
    var billClient = new rudp.Client(billSocket, '127.0.0.1', tedSocket.address().port);
    var tedClient = new rudp.Client(tedSocket, '127.0.0.1', billSocket.address().port);
    tedClient.on('data', function(data) {
      billClient.close()
      tedClient.close()
    })

    billClient.send(new Buffer('excellent!'))
  })
})

and here's the error stack trace:

dgram.js:439
    throw new Error('Not running'); // error message from dgram_legacy.js
          ^
Error: Not running
    at Socket._healthCheck (dgram.js:439:11)
    at Socket.send (dgram.js:282:8)
    at PacketSender.send (/Users/tenaciousmv/Code/node-rudp/lib/PacketSender.js:13:16)
    at null.<anonymous> (/Users/tenaciousmv/Code/node-rudp/lib/PendingPacket.js:23:24)
    at wrapper [as _onTimeout] (timers.js:287:14)
    at Timer.listOnTimeout (timers.js:133:15)
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

No branches or pull requests

1 participant