OK.

I don't think there's a built-in function that does what you want, but
you could add one that returns jsonrpc_session_get_seqno(idl->session).
If the value changes, there's been a connection or disconnection.

On Wed, Aug 30, 2017 at 11:13:11AM +0530, Arunkumar Rg wrote:
> Hi Ben,
> 
> I'm using ovsdb replication feature. Now when the server transitions from
> 'Active' to 'Backup' state, the client doesn't get a notification about the
> server's state(active/backup).
> Obviously the client can use 'ovsdb-server/sync-status' ctl command to pull
> the server's state info, but since it is a pull method, I need to do a
> periodic polling for getting server's state, which I think is costly.
> 
> Further, what I noticed is that the server resets all the remote
> connections when it's state changes. So I was thinking to pull the server's
> state only when the connection resets, instead of periodic polling.
> 
> In my client application(using ovsdb-IDL), I want to clear the
> application's info before the server's state changes to 'backup'.
> 
> Thanks,
> Arun.
> 
> On Wed, Aug 30, 2017 at 10:11 AM, Ben Pfaff <b...@ovn.org> wrote:
> 
> > On Wed, Aug 30, 2017 at 08:03:39AM +0530, Arunkumar Rg wrote:
> > > I'm using ovsdb_idl in my-ovsdb-client code. In my clide code, when I
> > > create the idl using ovsdb_idl_create(), I set the 'retry' argument has
> > > true, so that if the connection to server gets closed, it does a retry.
> > >
> > > Now from my client code, I wanted to know the session state with the
> > > server. Is there any API or any other way to do it??
> > >
> > > I need this because whenever the connection to server flaps, I wanted to
> > > take some action.
> >
> > Usually that's not too useful, because the data in the IDL is stable
> > across connection flaps.  Can you explain your higher-level goal?
> >
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to