• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Really Basic Q
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Really Basic Q (From: RR <email@hidden>)

  • Prev by Date: Really Basic Q
  • Next by Date: Re: disabling mulicast loopback + getting IP
  • Previous by thread: Really Basic Q
  • Next by thread: AOL port blocking
  • Index(es):
    • Date
    • Thread