• 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: POSIX sockets and event loops
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: POSIX sockets and event loops


  • Subject: Re: POSIX sockets and event loops
  • From: Douglas Davidson <email@hidden>
  • Date: Thu, 20 May 2004 19:00:34 -0700

On May 20, 2004, at 6:00 PM, Aaron Ballman wrote:

So let me see if I have the concept down. I would want to take the BSD
socket descriptor I make and pass it into a call to
CFSocketCreateWithNative. The options I would want to pass in for the
callback type are kCFSocketWriteCallBack and kCFSocketReadCallBack. After
creating the CFSocket, I would then make a run loop with
CFSocketCreateRunLoopSource and add it with CFRunLoopAddSource.

You create a run loop source and add it to the current run loop, as you describe. You can then release the CFSocket and the run loop source; the run loop will hang on to them. When you are finished, simply invalidate the CFSocket. You can arrange for this to close the socket or not, whichever you wish.

Then, in the callback I specify, I can just use my regular socket descriptor
to do the reading and the writing?

Just so.

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: 
 >Re: POSIX sockets and event loops (From: Aaron Ballman <email@hidden>)
 >Re: POSIX sockets and event loops (From: "Duane Murphy" <email@hidden>)
 >Re: POSIX sockets and event loops (From: "Aaron Ballman" <email@hidden>)

  • Prev by Date: Re: POSIX sockets and event loops
  • Next by Date: Re: POSIX sockets and event loops
  • Previous by thread: Re: POSIX sockets and event loops
  • Next by thread: Re: POSIX sockets and event loops
  • Index(es):
    • Date
    • Thread