[nanomsg] Re: Need help in identifying the connection lost in NANOMSG

  • From: "Garrett D'Amore" <garrett@xxxxxxxxxx>
  • To: "nanomsg@xxxxxxxxxxxxx" <nanomsg@xxxxxxxxxxxxx>
  • Date: Mon, 20 Oct 2014 09:12:20 -0700

There are many cases where knowing that a connection has terminated or is
unavailable can be useful.

HOWEVER, most of those cases are equally well served by having a timeout.
And nearly all of them involve the use of REQ/REP.  So for the vast
majority of cases, just using the timeout in handling a REQ lets you know
when the other side is not there.

Knowing the transport has disconnected is rarely useful generally, compared
to knowing the fact that the recipient is not around.  I don't know how you
can hope to achieve this without either using REQ/REP or inventing your own
notification protocol.  (In fact, in my self-tests for mangos, I did just
the latter -- a notification protocol that let me know the test peer was
ready to receive, and another to indicate successful reception or test
completion.)


On Mon, Oct 20, 2014 at 8:15 AM, Achille Roussel <achille.roussel@xxxxxxxxx>
wrote:

> May I ask why you need that? Nanomsg will reconnect as soon as possible
> and unless the backend is down it should work just as smoothly as if the
> connection never dropped.
>
> Achille Roussel
> +1 415 490 6339
>
> > On Oct 20, 2014, at 4:44 AM, Ramesh Ramachandran <rameshrg22@xxxxxxxxx>
> wrote:
> >
> > Hello Team,
> >
> > Am new to NANOMSG am using
> >
> > nn_socket(AF_SP, NN_PAIR) sockets.
> >
> > I want to know how to get the unexpected connection termination event in
> nanomsg sockets.
> >
> > Like ctrl+c event or kill the client by kill command or crash on client
> side. In this case there is no nn_close(). So how to identify the socket
> has been closed on the other side.
> >
> >
> >
> > --
> > With regards
> > Ramesh.R
>
>

Other related posts: