From d25f055d13a2c020b46e9845ccf00b91c658101c Mon Sep 17 00:00:00 2001 From: Mathias Buus Date: Wed, 8 Sep 2021 12:41:20 +0200 Subject: [PATCH] onmessage expects socket as well --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 532dcaa..8cf7ca8 100644 --- a/index.js +++ b/index.js @@ -77,8 +77,8 @@ class DHT extends EventEmitter { return this._nat.port } - onmessage (buf, rinfo) { - if (buf.byteLength > 1) this.io.onmessage(null, buf, rinfo) + onmessage (socket, buf, rinfo) { + if (buf.byteLength > 1) this.io.onmessage(socket, buf, rinfo) } bind () {