Re: Really Basic Q
Re: Really Basic Q
- Subject: Re: Really Basic Q
- From: Douglas Davidson <email@hidden>
- Date: Tue, 24 Sep 2002 11:37:35 -0700
On Tuesday, September 24, 2002, at 10:50 AM, RR wrote:
Hello all, using some example code from Douglas Davidson, and reading
a header file or two, I have constructed a call to
CFSocketCreateConnectedToSocketSignature() using kCFSocketDataCallBack
and it appears to work. Using netstat I can see that a client
connection does open.
But I am having two problems. Firstly, it does not appear that my
callback function is ever called.
Make sure that your socket's run loop source has been added to the run
loop, and that the run loop is running.
Secondly, how do I take the data that's given to my callback function,
and for example, display it in an NSTextView. I can't seem to figure
out how to exchange data between CoreFoundation and the Appkit.
Because my callback must be a C function and not Objective C, I cannot
reference [self] from within it.
No, you can't reference self, but you can call methods on other
objects. One common idiom is to use the CFSocket's context to contain
a pointer to a related object that should be messaged.
Douglas Davidson
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.