[nanomsg] Re: How nanomsg informs application about socket failure

  • From: BELLUS Stefan <Stefan.Bellus@xxxxxxxxxxxxxx>
  • To: Garrett D'Amore <garrett@xxxxxxxxxx>, "nanomsg@xxxxxxxxxxxxx" <nanomsg@xxxxxxxxxxxxx>
  • Date: Wed, 9 Apr 2014 08:39:30 +0000

Thank for you time.

From my point of view the conclusion is:
- I have to read sources and try nanomsg
- It would be very useful for my scenario when nanomsg informs application when 
it starts reconnection based on NN_RECONNECT_IVL and let application decide how 
to proceed.

Thank you again
Stevo


From: Garrett D'Amore [mailto:garrett@xxxxxxxxxx]
Sent: Tuesday, April 08, 2014 9:12 PM
To: BELLUS Stefan; nanomsg@xxxxxxxxxxxxx
Subject: RE: [nanomsg] Re: How nanomsg informs application about socket failure

Well, if your just using this for metadata, then its probably *also* ok.  I 
mean, if the UI can cope with an occasional dropped message, why not.  I 
imagine this is like FM radio stations that supply meta data to radios about 
songs played, etc.  If the connection is poor, the meta data doesn’t get 
through, and you just don’t display it.  :-)

You probably don’t want to track connection lifetimes though.  What you’d do in 
this case is open a separate socket for each call, because you need to 
disconnect from the underlying transport when the call is ended.

What you’re really getting from nanomsg at this point is merely framing.  :-)

--
Garrett D'Amore
Sent with Airmail


On April 8, 2014 at 11:18:32 AM, BELLUS Stefan 
(stefan.bellus@xxxxxxxxxxxxxx<mailto:stefan.bellus@xxxxxxxxxxxxxx>) wrote:
Thank you.

By the way, it is not about audio. It is transported via E1 line.

The data are used only to provide some additional information e.g calee name.

Br
Stevo
________________________________________
From: Garrett D'Amore [garrett@xxxxxxxxxx]
Sent: Tuesday, April 08, 2014 5:48 PM
To: BELLUS Stefan; nanomsg@xxxxxxxxxxxxx<mailto:nanomsg@xxxxxxxxxxxxx>
Subject: Re: [nanomsg] Re: How nanomsg informs application about socket failure

For PCM audio, you can probably suffer the occasional dropped message, so PAIR 
might be a good choice for you! You won’t get any resends, but if this is a 
streaming situation (SIP), that’s a good thing.

With nanomsg, you won’t see the underlying connctions “drop” though. Instead, 
you’ll just see that messages don’t get delivered, or get delivered “late”. 
This could work if you cope with this in the application. You should probably 
have an applicatoin layer timer, and probably also time stamp your packets for 
an audio application.

--
Garrett D'Amore
Sent with Airmail


On April 8, 2014 at 4:50:08 AM, BELLUS Stefan 
(stefan.bellus@xxxxxxxxxxxxxx<mailto:stefan.bellus@xxxxxxxxxxxxxx<mailto:stefan.bellus@xxxxxxxxxxxxxx%3cmailto:stefan.bellus@xxxxxxxxxxxxxx>>)
 wrote:

May be I don't choose appropriate pattern.

Let's assume following scenario:

< ---- SipCall with RTP ---> M1 <--- audio as PCM, data via nanomsg ---> M2

M1 - machine 1
M2 - machine 2

SipCall has to be released when M2 is down
SipCall has to be released when M2 reports error (error can happen any time)
M1 needs to send data any time to M2

Because PCM audio is point to point, I guess the PAIR is enough for me.

I use langue for my domain, but hopefully I explain my scenario.

Br
Stevo

-----Original Message-----
From: nanomsg-bounce@xxxxxxxxxxxxx<mailto:nanomsg-bounce@xxxxxxxxxxxxx> 
[mailto:nanomsg-bounce@xxxxxxxxxxxxx] On Behalf Of Martin Sustrik
Sent: Tuesday, April 08, 2014 1:00 PM
To: nanomsg@xxxxxxxxxxxxx<mailto:nanomsg@xxxxxxxxxxxxx>
Subject: [nanomsg] Re: How nanomsg informs application about socket failure

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/04/14 12:24, BELLUS Stefan wrote:

> I read briefly the documentation. I am not able to figure out how
> nanomsg informs application about socket failure.
>
> Can somebody explain to me for following scenario: I have two linux
> machines connected with PAIR socket. I use async socket via
> nn_poll. I set NN_RECONNECT_IVL and NN_RECONNECT_IVL_MAX
>
> 1. Communication is established between machine M1 and machine M2
> 2. M2 shutdowns
>
> How nanomsg informs application that socket has failure? How
> nanomsg informs application that socket is established again (when
> M2 starts again?

Hi,

There's no notification. The pattern handles the failure in its own
way. For example REQ/REP resends the request after a timeout.

However, PAIR is a rather lame pattern, and you probably should not
use it unless you have very good idea of what you are doing.

Martin

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJTQ9aeAAoJENTpVjxCNN9YCasH/3Dt3zfW9i3AfiAf7wbjnlIc
HCuBq5gmYrzkU9wnqFEaHbqclqhMhtwIvUTFys5UjYqqbdXp1DidW+QNV5k+aitL
7CSGrWlLcgAfn4gDpVpeMcU83TLkp8mYsQ0XV6zZiOt925IS6iB1cuQ02GUTC//0
pBggcCio2kyUPNLxHYNQlwCY4unbI3GPna8RrcIdu3jiTB3AgTNDfebaGHc+mjnJ
Q1iM4WQ0q3TrIZpnl5y6hPwgExu/vVwjfQSvUUuVT5SklgCan+LS9Z7bYgi2uB0n
rxdm7WTBtOstJo5msMGSllPBGbYBUJJSW/0iDmidfp/HF0xWbEpGBfbDkLK7P2U=
=ERJ4
-----END PGP SIGNATURE-----

Other related posts: