Comments (16)
Make sure the NN_RCVTIMEO option is set though!
On Jun 1, 2015, at 2:17 PM, Alisson Cavalcante Agiani [email protected] wrote:
According to @gdamore https://github.com/gdamore on nanomsg gitter channel:
REQ will return ETIMEDOUT on recv() if the timeout expires.
So far I've tried every configuration possible and req.on("timeout", function() { ... }) never fires.—
Reply to this email directly or view it on GitHub #93.
from node-nanomsg.
Oh yeah, I've tried setting it to 1, nothing happened
from node-nanomsg.
@thelinuxlich do you have a small test case we could add to our test suite to work against?
from node-nanomsg.
Btw, ETIMEOUT does not apply to RAW sockets -- only to cooked ones.
from node-nanomsg.
Huh. In my testing I'm getting EAGAIN instead of ETIMEDOUT. That's ... not what it should be.
from node-nanomsg.
@gdamore , note we statically link an older version of Nanomsg. If that was recently fixed, we can update our dependency.
from node-nanomsg.
Huh. In libnanomsg ETIMEDOUT is intentionally turned into EAGAIN:
rc = nn_efd_wait (&self->rcvfd, timeout);
if (nn_slow (rc == -ETIMEDOUT))
return -EAGAIN;
This feels like a mistake to me, but I need to make further research. Nonetheless, EAGAIN or ETIMEDOUT -- you do get a timeout. Blocking mode only of course. (nonblocking sockets cannot distinguish a "timeout" as such.)
from node-nanomsg.
hmmm req.send is non-blocking in node-nanomsg? If it is we are lost concerning timeouts? :(
from node-nanomsg.
@nickdesaulniers I'm trying to get the timeout event with this simple server implementation: https://gist.github.com/thelinuxlich/1e55ef121874d127ceca
from node-nanomsg.
Well, you're missing a rep socket. Req/rep are meant to be used as a pair. I should add an example for this...
from node-nanomsg.
for now, see this test
from node-nanomsg.
no, I'm testing exactly the absence of a consumer listening to see a timeout event
from node-nanomsg.
indeed, we do not emit a timeout event anywhere. Note the ability to specify socket options were added recently, and aren't fully tested other than check for their existence. See #52. What function in nanomsg returns ETIMEOUT or EAGAIN? That would help me figure out how to wire it up.
from node-nanomsg.
Stack looks like nn_send -> nn_sendmsg -> nn_sock_send -> EAGAIN
from node-nanomsg.
@gdamore said REQ is sending EAGAIN
from node-nanomsg.
nn_recv gets the EAGAIN.
Sent from my iPhone
On Jun 1, 2015, at 3:17 PM, Nick Desaulniers [email protected] wrote:
Stack looks like nn_send -> nn_sendmsg -> nn_sock_send -> EAGAIN
—
Reply to this email directly or view it on GitHub.
from node-nanomsg.
Related Issues (20)
- add support for nng HOT 4
- Error handling HOT 3
- TypeError: Path must be a string. Received undefined HOT 2
- rfc links
- Compile error in Node V12.* HOT 6
- vulnerable dependencies HOT 1
- deprecation warning from Nan::Callback::call HOT 2
- DeprecationWarning: Buffer HOT 2
- remove package-lock.json from .gitignore HOT 2
- fallthrough warnings in nanomsg HOT 1
- are we handling scopes correctly? HOT 1
- How do i catch timeout on reqrep?
- Carsh When msg send 10K per second HOT 2
- Electron compatibility: "Loading non-context-aware native module in renderer" HOT 1
- node 14.15 compatability HOT 1
- (node:660) electron: The default of contextIsolation is deprecated and will be c hanging from false to true in a future release of Electron. HOT 2
- Double handle scope
- -Wcast-function-type in nodejs/src/node.h
- sub: filter by binary chan prefix? HOT 1
- npm install --use_system_libnanomsg=true fails
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-nanomsg.