On 07/30/09 13:28, "Christiaan Hofman" <cmhof...@gmail.com> wrote:
> On Jul 30, 2009, at 9:13 PM, Maxwell, Adam R wrote: > >> DO has so >> much magic >> involved that it's hard to know what went wrong. What bothers me is >> that >> calling write() on the same socket from different threads or objects >> seems >> wrong, so I'm not sure they can be the same. >> > > I think for any single port setup to work the netservice and the > connection should better work on the same thread, in this case the > background thread. Yeah, I think that might work, but you have no control over what thread the bonjour advertisement runs on. When you call publish, NSNetService could run its own thread, as well as use a runloop source (strange as that would be). It was just easier to let NSNetService and NSSocketPort choose their own ports and be done with it. I know people have asked for a fixed port, but Leopard's firewall takes care of that in a much nicer way. > I wish Apple had a sample of DO and Bonjour, but all available sample > code seems to be either one or the other. I've never seen any sample code that uses both, so I modified the PictureSharing sample to use DO. I've still never seen sample code other than my own that tears down a DO connection without leaking mach ports; in fact, I filed a doc request on that over 2 years ago and it's still open. My guess is that Apple wishes DO would just go away, given their lack of attention to it. ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Bibdesk-develop mailing list Bibdesk-develop@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bibdesk-develop