dgram-uv: black hole incoming messages after closing

Fixes test/simple/test-dgram-pingpong.js on windows
pull/5370/head
Bert Belder 2011-09-05 03:30:12 +02:00
parent 01bf209a3d
commit b5d58f11cb
1 changed files with 5 additions and 1 deletions

View File

@ -285,7 +285,11 @@ Socket.prototype._stopReceiving = function() {
if (!this._receiving)
return;
this._handle.onmessage = null;
// Black hole messages coming in when reading is stopped. Libuv might do
// this, but node applications (e.g. test/simple/test-dgram-pingpong) may
// not expect it.
this._handle.onmessage = noop;
this._handle.recvStop();
this._receiving = false;
this.fd = null; // compatibility hack