You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I might be doing something incorrect here, but when I call unbindSync it gives the error Error: Address already in use.
Reproducing
* eslint-disable */
import zmq from 'zeromq/v5-compat.js';
function main() {
const pub = zmq.socket("pub")
const sub = zmq.socket("sub")
pub.on("bind", address => {
console.log(`Bound to ${address}`)
})
pub.bind("tcp://127.0.0.1:3456", err => {
if (err) {
throw err
}
sub.connect("tcp://127.0.0.1:3456")
console.log("Subscriber connected to tcp://127.0.0.1:3456")
sub.on("message", msg => {
// Handle received message...
console.log(`Received message: ${msg.toString()}`)
})
pub.send("message")
})
setTimeout(() => {
pub.unbindSync("tcp://127.0.0.1:3456")
process.exit(0)
}, 2000)
}
main()
Bound to tcp://127.0.0.1:3456
Subscriber connected to tcp://127.0.0.1:3456
node_modules/zeromq/lib/compat.js:291
this._socket.unbindSync(address);
^
Error: Address already in use
at Socket.unbindSync (node_modules/zeromq/lib/compat.js:291:22)
at Timeout._onTimeout (file:///zeromq.js:30:7)
at listOnTimeout (node:internal/timers:581:17)
at process.processTimers (node:internal/timers:519:7) {
errno: 98,
code: 'EADDRINUSE',
address: 'tcp://127.0.0.1:3456'
}
Node.js v20.18.3
Expected behavior
Since the address is already in use, I expected unbindSync to release the port
Tested on
OS: Ubuntu 24.04
Node.js 20
ZeroMQ.js version: 6.3.0
The text was updated successfully, but these errors were encountered:
Wayonb
changed the title
unable to unbindSync form a publisher socket with compat mode
unable to unbindSync from a publisher socket with compat mode
Feb 20, 2025
Describe the bug
I might be doing something incorrect here, but when I call unbindSync it gives the error
Error: Address already in use.
Reproducing
Expected behavior
Since the address is already in use, I expected
unbindSync
to release the portTested on
The text was updated successfully, but these errors were encountered: