[nanomsg] Re: Detecting connection/disconnection/re-connection

  • From: Roberto Fichera <kernel@xxxxxxxxxxxxx>
  • To: nanomsg@xxxxxxxxxxxxx
  • Date: Wed, 6 Dec 2017 19:43:10 +0100

On 12/06/2017 07:14 PM, Garrett D'Amore wrote:

Extending nanomsg to give these events might be challenging, because the FSM 
are a pain.  You can look at
nn_pipebase_start as a starting point (and nn_pipebase_stop).  None of this 
was designed with your use case in mind.

Thanks! Will have a look. I would have something temporary to get notified 
regarding such states. This is important because
can permit to restore/feed a state of system if you are continuously restarting 
it for prototyping or testing purpose
especially
with embedded systems.


The nng stuff is coming along, and frankly, that might be a better solution 
for you, depending upon your time frame.

As usual time is always a constraint. But indeed I'm monitoring the list and 
the upcoming nng work and happy to migrate
as soon
as nng is stable enough for production. I'm interested at C API, python 
bindings and see how it works with my
messagepack rpc
library over nanomsg "transport".



On Wed, Dec 6, 2017 at 9:29 AM Roberto Fichera <kernel@xxxxxxxxxxxxx 
<mailto:kernel@xxxxxxxxxxxxx>> wrote:

    On 12/06/2017 05:44 PM, Garrett D'Amore wrote:
    In nanomsg, no there is no direct API for this.  (You can “guess” based 
on statistics reports, but that’s not
    guaranteed to be accurate.)

    Ok! Can you please point me where I can have a look in the C code so I 
can extend in our local fork?



    In nng, there will be event callbacks for these; right now that part of 
nng’s API is not yet implemented.

    Ok! That's nice



    In mangos (the pure Go implementation of these protocols) there *are* 
notifications on these events.  (See the
    SetPortHook method on the socket.)

    Ok! Will have a look



    On Wed, Dec 6, 2017 at 8:15 AM Roberto Fichera <kernel@xxxxxxxxxxxxx 
<mailto:kernel@xxxxxxxxxxxxx>> wrote:

        Hi All,

        I'm interested to know if there is a way to know when a client 
connect/disconnect or re-connect
        to a particular endpoint. I would like to know this information 
because I need to take some actions
        on client side once the server re-connect and/or disconnect.

        I know that nanomsg handle that transparently, but is there anyway 
to get notified about that?

        Thanks in advance,
        Roberto Fichera.



Other related posts: