Re: INADDR_ANY not wokring
Re: INADDR_ANY not wokring
- Subject: Re: INADDR_ANY not wokring
- From: Gary Carlson <email@hidden>
- Date: Tue, 20 May 2008 17:46:24 -0700
- Thread-topic: INADDR_ANY not wokring
Title: Re: INADDR_ANY not wokring
I am not sure what you are trying to do. Are you trying to establish a client or server connection? INADDR_ANY is typically used to specify a server that will accept connections from any client either through the local or remote interfaces.
Gary
On 5/20/08 5:22 PM, "Kenneth Perry Hough" <email@hidden> wrote:
Hi,
I am definitely missing something obvious but I just can't figure it out. I'm sorry if it's a simple answer, and I'm pretty sure it is, but when I use INADDR_ANY to get my local address I get 0.0.0.0 instead of what my ip address is on en0 or en1, depending on the interface I am using. I'm used to Linux/Unix programming and I'm pretty sure there isn't much of a difference for MacOS X is UNIX based, but I may be missing something. The following is the snippet of my code:
host.sin_family = AF_INET;
host.sin_port = port;
host.sin_addr.s_addr = INADDR_ANY;
memset(&host.sin_zero , '\0', sizeof(host.sin_zero));
Thanks in advance,
Kenneth
_______________________________________________
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
_______________________________________________
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