Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
dgram-uv: black hole incoming messages after closing
Browse files Browse the repository at this point in the history
Fixes test/simple/test-dgram-pingpong.js on windows
  • Loading branch information
piscisaureus committed Sep 5, 2011
1 parent 01bf209 commit b5d58f1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/dgram_uv.js
Expand Up @@ -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
Expand Down

0 comments on commit b5d58f1

Please sign in to comment.