Gary Wright
2/3/2009 12:14:00 AM
On Feb 2, 2009, at 4:50 PM, Anukul Singhal wrote:
>
> In the last method bind, getting the following error:
>
> Test.rb:50:in `bind': The requested address is not valid in its
> context.
> - bind(2) (Errno::EADDRNOTAVAIL)
>
> I think I might be missing something elementary here. If anyone can
> please help with it, would be really grateful.
Usually you don't pick the local address to bind to but instead
let the system pick it. Is 114.23.42.42 your local address or is
the address of the device you are trying to connect to?
If you are trying to bind a local socket to the address of the
remote host/device you'll get EADDRNOTAVAIL since the address
doesn't belong to the local host.
Gary Wright