NSStream Subclass and Runloops
NSStream Subclass and Runloops
- Subject: NSStream Subclass and Runloops
- From: Greg Hulands <email@hidden>
- Date: Mon, 17 Oct 2005 19:41:34 +1000
Hi,
I am writing an NSStream subclass that wraps around a distributed
object that another framework is vending over Bonjour. The only
method of the object vended is - (int)retrievePacketsInto:(NSData **)
data; basically it just returns a data buffer wrapped as an NSData. I
wanted to wrap this up as a stream subclass, but I cannot use
NSInputStream 's inputStreamWithData: as I have to poll the remote
object to get more data to fill the local buffer. I have added the
proxy's connection to the runloop. But cannot figure out how I can
get a call back each pass through the runloop to get more data from
the remote object. I cannot use the NSConnection's receivePort as it
says the NSConnection is the delegate of the port. There are no
delegate methods of the NSConnection that would invoke as the remote
object only returns data when asked for it and does not send it willy
nilly.
Because I cannot get a callback from the runloop, I cannot notify the
delegate of the stream that data has arrived.
Any info on how to do this would be appreciated.
Regards,
Greg
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden