• 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: "Aaron Ballman" <email@hidden>
  • Date: Thu, 20 May 2004 20:00:52 -0500

> I would take a look at CFSocket. It's not a large investment and I am
> pretty certain that you can isolate the code from the POSIX code. As it
> is now it sounds like you're polling select() in order to find out if
> there is network I/O.

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.

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

Does that sound like an alright scheme?

~Aaron
_______________________________________________
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.


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