Re: Looking for CFSocket UPD setup and data-xfer samples/tutorials
Re: Looking for CFSocket UPD setup and data-xfer samples/tutorials
- Subject: Re: Looking for CFSocket UPD setup and data-xfer samples/tutorials
- From: Josh Graessley <email@hidden>
- Date: Tue, 17 Feb 2009 16:19:00 -0800
On Feb 17, 2009, at 4:04 PM, Michael A. Crawford wrote:
Thanks for the reply, Quinn. I'm surprised at how few examples
there are for this sort of code. Loads of TCP examples though. In
that arena, everyone seems to be re-using Apple's TCPServer class.
I've actually seen the code you pointed me to before. My problems
is in successfully transmitting a UDP packet, not receiving. Seems
like it would be quite simple but it doesn't work. I've written a
simple test app using old Berkeley style sockets with blocking
calls, which works just fine. Next, I'm going to re-write said
program to use CFSocket and CFRunLoop. I'm hoping that If I can get
it working, with those new Apple API calls, I can figure out what I
did wrong in my application, which isn't working.
CFSocket is handy for knowing when an event occurs on a socket. For
UDP sockets, the only interesting event is in the receive side
indicating there is data to be read. For writing to a UDP socket,
there is no buffering or flow control. The file descriptor will always
be ready to write.
-josh
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden