Re: Getting UDP sockets to work
Re: Getting UDP sockets to work
- Subject: Re: Getting UDP sockets to work
- From: Quinn <email@hidden>
- Date: Mon, 11 Aug 2008 11:37:45 +0100
At 1:19 +0800 10/8/08, Liwei wrote:
So am I right to say that CFSocket is just a thin wrapper around the
native BSD sockets such that I can use run loops?
That's absolutely correct. The primary goal of CFSocket is to
provide a way to integrate sockets in a runloop. Doing this without
CFSocket is a total pain.
Can someone explain to me what is wrong?
If you're running this on Intel then the one thing that's definitely wrong is:
At 1:19 +0800 10/8/08, Liwei wrote:
struct sockaddr_in sin_struct = {0, AF_INET, 5555, 0};
You need a "htons" around the 5555, just like you would if you used
the BSD sockets API.
With that fix in place I ran your program and it worked AFAICT.
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
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