On Fri, Jul 05, 2013 at 08:18:59PM +0700, Alexey Dokuchaev wrote: > On Fri, Jul 05, 2013 at 01:48:41PM +0100, Daniel P. Berrange wrote: > > On Fri, Jul 05, 2013 at 07:16:03PM +0700, Alexey Dokuchaev wrote: > > > [...] > > > What I need to do, is first to reestablish new connection to newly run > > > devd, and then g_io_channel_shutdown(...)/g_object_unref(oldsocket). > > > > IMHO the order you have here ought to be ok. > > My thinking the reason for calling devd_init() first, then cleaning up is > because it takes sertain time to devd to reappear and start serving again. > In indication of this is a series of repeating failing connect() calls if > perror()'ing them... But I might be wrong.
Yep, that sounds pretty likely indeed. If you get a failure to reconnect to devd, then you can use g_timeout_add to re-schedule an attempt to connect 1 second later, or something like that. > > > Can you send the code you currently have, so I can see the bigger > > picture of how you now have it written. > > Sure, attached is the current version of entangle-device-manager.c. The code you have looks fine, so I think it just needs to try to do the reschedule to reconnect attempt Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :| _______________________________________________ Entangle-devel mailing list Entangle-devel@gna.org https://mail.gna.org/listinfo/entangle-devel