Re: WSAEADDRNOTAVAIL how to resolve
From: Omar [MS] (omarm_at_online.microsoft.com)
Date: 09/28/04
- Next message: The Last Gunslinger: "Re: Looking for suggestions"
- Previous message: jayderk: "Re: Looking for suggestions"
- In reply to: cg: "WSAEADDRNOTAVAIL how to resolve"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 28 Sep 2004 15:39:13 -0700
Are you binding to a specific port? If so try changing the port does it
work. You can also specify the port to be 0 in which case the stack will
choose a free port for you.
If the above step fails or you're already binding to 0, try binding to
address 0 (techinically INADDR_ANY), again the stack will pick an
appropriate interface for you. After doing binding to ip address INADDR_ANY,
and port 0, assuming you succeed you can get the address that it bound to
and make sure that it was the same one you were trying.
Another common mistake is that you may be using the address with the bytes
in the wrong order try binding with net_long(ipaddr).
Thanks,
- Omar
-- This posting is provided "AS IS" with no warranties, and confers no rights. Please do not send email directly to this alias. This alias is for newsgroup purposes only. "cg" <cg@discussions.microsoft.com> wrote in message news:952A28A8-B9AD-42B0-8621-8BE24405E589@microsoft.com... > I am creating UDP socket with AF_INET, SOCK_DGRAM, IPPROTO_UDP options. > When I do bind I get error WSAEADDRNOTAVAIL. The documentation on window CE > states specifying an IP address in bind that does not correspond to a local > IP interface will generate this error. The local IP address is correct. > > Does anyone can tell me how to correct this error/what to look for.
- Next message: The Last Gunslinger: "Re: Looking for suggestions"
- Previous message: jayderk: "Re: Looking for suggestions"
- In reply to: cg: "WSAEADDRNOTAVAIL how to resolve"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|