node-nanomsg | Node.js binding for nanomsg | Runtime Evironment library
kandi X-RAY | node-nanomsg Summary
kandi X-RAY | node-nanomsg Summary
Node.js binding for nanomsg
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of node-nanomsg
node-nanomsg Key Features
node-nanomsg Examples and Code Snippets
Community Discussions
Trending Discussions on node-nanomsg
QUESTION
I have two .js
files - pub.js
for publication and sub.js
for subscription. These files are actually a 'split' version of the example shown on node-nanomsg GitHub site. The pub.js
writes to tcp://127.0.0.1:7789
and sub.js
reads from the same. I start the sub.js
first followed by pub.js
. While the pub.js
completes quickly, the sub.js
never receives the message.
pub.js
...ANSWER
Answered 2018-Nov-20 at 12:51It seems like the communication is closed by the publisher before binding the tcp socket completes.
The library doesn't provide async versions of bind
and connect
, and it seems like bind
doesn't completely finish executing when the function returns. Adding a timeout is just a workaround for this problem.
See this discussion on their Github repository: rewrite bind/connect and remove setTimeouts from tests
Unfortunately the pull request got closed and the async feature is still not implemented.
If you look at the examples they provide, they all rely on timeouts, which means the problem is acknowledged by the developers. In my opinion this library is not ready for production use, because of this reliance on timeouts.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install node-nanomsg
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page