On Wed, 2011-01-26 at 13:12 +0100, Karl Relton wrote:
> On Wed, 2011-01-26 at 21:30 +0930, Iain Buchanan wrote:
> > On Sun, 2011-01-23 at 21:28 +0000, Mark Ellis wrote:
> > 
> > > I actually have no idea how to fix it at the moment, but I know exactly
> > > why it happens. When a device connects, we open a listening tcp server
> > > on port 990 and 5679, the first is for WM5 and the second is for
> > > 'legacy'. We do both because we dont know what kind it is yet. When the
> > > Wm2003 device connects to port 5679, we close the server on 990 because
> > > we don't need it.
> > > 
> > > But it doesn't close on 990, so when the device is unplugged and
> > > replugged, we again open both servers, but 990 failed to close, so when
> > > we try and open it we get an error.
> > > 
> > > I've gone right down to trying to close the file descriptor manually, no
> > > good. It's bound to be something obvious. Anyone that spots it gets to
> > > be King of Synce !!!!!!
> > 
> > can you run netstat and see what state the port is in after unplugging
> > the device?  I'm a little rusty on my socket programming...
> > 
> 
> netstat -l -t   shows the port 990 as still listening after the unplug,
> because of the bug.
> 
> The following patch fixes it!
> 
> --- synce-device-manager.c.orig       2011-01-26 12:06:31.076751002 +0000
> +++ synce-device-manager.c    2011-01-26 12:07:15.360751014 +0000
> @@ -123,7 +123,7 @@
>  
>    GSList *device_entry_iter = priv->devices;
>    while (device_entry_iter) {
> -    if ((((DeviceEntry*)device_entry_iter->data)->server_990 = server) || 
> (((DeviceEntry*)device_entry_iter->data)->server_5679 = server))
> +    if ((((DeviceEntry*)device_entry_iter->data)->server_990 == server) || 
> (((DeviceEntry*)device_entry_iter->data)->server_5679 == server))
>        break;
>      device_entry_iter = g_slist_next(device_entry_iter);
>    }
> 
> 
> 

You're an absolute legend !!!!!!

Had to be something daft like that, it was too wierd not to be. Me hides
embarrassed grin :)

Right, here's the plan then. With this and the modified legacy rule,
connector is basically good to go.

However, libgnet is old and unmaintained, and even Debian are
deprecating it. I'm making a concerted effort to port to gio instead of
gnet. If that goes well, I'll commit some changes, upload a package to
the PPA, and we can try it out before release. If that starts looking
complex, I'll release still with gnet and do the gio stuff later.

Mark

Attachment: signature.asc
Description: This is a digitally signed message part

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
SynCE-Devel mailing list
SynCE-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synce-devel

Reply via email to