discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSRunLoop and Events


From: Richard Frith-Macdonald
Subject: Re: NSRunLoop and Events
Date: Fri, 16 Apr 2004 05:51:06 +0100


On 15 Apr 2004, at 22:15, Stefan Kleine Stegemann wrote:

Hi,

GNUstep provides the possibility to register for events with a runloop
(addEvent:type:watcher:forMode:). As far as i understand, I have
to specify an fd that then is monitored by the runloop. When an
event on the fd occurs, receivedEvent gets called on the watcher.

Yes.

Assuming that the above is right, is it possible to specify an fdset
instead of a single fd (the API just says (void*) for the event parameter
of addEvent)?

No ... the use of void* is just future-proofing for possible future systems like a possibility of using native file handles on ms-windows rather than file descriptors. It only supports file descriptors now, and the api is only
intended to monitor for events on single sources.

I have a couple of fd's and want to get notfied whenever
an event occurs on one of this fd's. I don't have the possibility to
register an event for each fd because the library i'm using gives me
only an fdset.

I don't see why that should be a problem ... keep a copy of the last
fdset used, and whenever you get a new fdset, you can compare
it with the previous version to see which fds have been added/removed
and call the methods to add/remove those fds to the runloop.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]