Giter VIP home page Giter VIP logo

Comments (16)

gdamore avatar gdamore commented on August 27, 2024

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.

thelinuxlich avatar thelinuxlich commented on August 27, 2024

Oh yeah, I've tried setting it to 1, nothing happened

from node-nanomsg.

nickdesaulniers avatar nickdesaulniers commented on August 27, 2024

@thelinuxlich do you have a small test case we could add to our test suite to work against?

from node-nanomsg.

gdamore avatar gdamore commented on August 27, 2024

Btw, ETIMEOUT does not apply to RAW sockets -- only to cooked ones.

from node-nanomsg.

gdamore avatar gdamore commented on August 27, 2024

Huh. In my testing I'm getting EAGAIN instead of ETIMEDOUT. That's ... not what it should be.

from node-nanomsg.

nickdesaulniers avatar nickdesaulniers commented on August 27, 2024

@gdamore , note we statically link an older version of Nanomsg. If that was recently fixed, we can update our dependency.

from node-nanomsg.

gdamore avatar gdamore commented on August 27, 2024

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.

thelinuxlich avatar thelinuxlich commented on August 27, 2024

hmmm req.send is non-blocking in node-nanomsg? If it is we are lost concerning timeouts? :(

from node-nanomsg.

thelinuxlich avatar thelinuxlich commented on August 27, 2024

@nickdesaulniers I'm trying to get the timeout event with this simple server implementation: https://gist.github.com/thelinuxlich/1e55ef121874d127ceca

from node-nanomsg.

nickdesaulniers avatar nickdesaulniers commented on August 27, 2024

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.

nickdesaulniers avatar nickdesaulniers commented on August 27, 2024

for now, see this test

from node-nanomsg.

thelinuxlich avatar thelinuxlich commented on August 27, 2024

no, I'm testing exactly the absence of a consumer listening to see a timeout event

from node-nanomsg.

nickdesaulniers avatar nickdesaulniers commented on August 27, 2024

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.

nickdesaulniers avatar nickdesaulniers commented on August 27, 2024

Stack looks like nn_send -> nn_sendmsg -> nn_sock_send -> EAGAIN

from node-nanomsg.

thelinuxlich avatar thelinuxlich commented on August 27, 2024

@gdamore said REQ is sending EAGAIN

from node-nanomsg.

gdamore avatar gdamore commented on August 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.