Hi Ivan,

>> I don't understand what you mean by "connected to a notification".
> 
> David is, if I understand correctly, referring to using methods such as 
> -[NSFileHandle acceptConnectionInBackgroundAndNotify] after creating the file 
> handle with -[NSFileHandle initWithFileDescriptor:closeOnDealloc:].

thanks for your explanation. I really had no idea what David was referring to, 
yet it's really obvious in hindsight. I don't know exactly why, but I had the 
incorrect assumption that acceptConnectionInBackgroundAndNotify (and friends) 
were using background threads instead of attaching the file descriptors to the 
runloop (which they do).


> The relevant piece of code that I described does not seem broken, and the 
> general idea seems to be sound.

Yes, that approach seems plausible and will work. (The problem in the code at 
http://stackoverflow.com/questions/4677724/nsfilehandle-function-acceptconnectioninbackgroundandnotify-not-working-when-cal
 seems to be that he uses ARC but never retains the remoteFileHandle, causing 
the connection to be dropped as soon as remoteFileHandle is dealloced).

However, in my program's context I prefer Richard's approach, because it's 
modelled exactly the same as how you interact with a Bonjour service and that's 
what I already do there.

Thanks for your suggestions!


Cheers,

  Marcus

-- 
Marcus Müller  .  .  .  http://www.mulle-kybernetik.com/znek/



Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@gnu.org
https://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to