Re: POSIX sockets and event loops
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.