Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Debugging NSNetServiceBrowser
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Debugging NSNetServiceBrowser




On 13-Feb-05, at 11:08 AM, Hamish Allan wrote:

(Replying to myself...)

On Feb 13, 2005, at 15:21, I wrote:

I am just off to try writing code that does the fgetln() in a new thread and then calls performSelectorOnMainThread:withObject:waitUntilDone:NO to communicate the results, which I think might work.

It worked. I had to create and add an empty port to my run loop to stop the run method exiting immediately... perhaps there is a better way to handle this?

I'm not sure about a better way, see below:

From http://developer.apple.com/documentation/Cocoa/Conceptual/InputControl/ index.html#//apple_ref/doc/uid/10000062i

"Note: Regardless of the date you specify in runMode:beforeDate: and runUntilDate:, a run loop with nothing to do (that is no sources from which to receive input) exits immediately. You must add the input sources to the run loop mode before you start the run loop. Other parts of the system may add their own sources to a particular run loop mode, but do not depend on this always being the case. Add an empty NSPort to a run loop if you need to guarantee that it does not exit immediately"

I'd forgotten about empty run loops; they exit immediately.

Rob

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Rendezvous-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Debugging NSNetServiceBrowser (From: Hamish Allan <email@hidden>)
 >Re: Debugging NSNetServiceBrowser (From: Chris Parker <email@hidden>)
 >Re: Debugging NSNetServiceBrowser (From: Hamish Allan <email@hidden>)
 >Re: Debugging NSNetServiceBrowser (From: Robert MacGregor <email@hidden>)
 >Re: Debugging NSNetServiceBrowser (From: Hamish Allan <email@hidden>)
 >Re: Debugging NSNetServiceBrowser (From: Hamish Allan <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.