T
thammond
I am working with XP Embedded on a multi-homed single board computer
(target). Each of the two NICs on this target is assigned at least one
static IP address (not using DHCP). Only one of these NICs will
connect with an external computer (the other igoes to another internal
single board computer).
I have to run a 3rd-party application on this target that creates a set
of Windows sockets for users to interface with it. To connect to these
sockets, I must know (at compile time) what IP address those sockets
are going to bind to. Also, applications external to the target must
be able to connect to these sockets, so they too must know the IP
address in advnace.
It appears that the 3rd-party application is using gethostbyname() to
determine which IP Address it binds its sockets to. The troubling part
is that I have seen it bind to different IP addresses when run on
identical processor cards.
I know this is probably not a standard use of network facilities,
but it's what I'm stuck with.
Q: In a multi-homed system, how can I configure which IP address is
used to resolve the system's response to gethostbyname()?
I have tried re-adding the IP address in different order, adding an
entry in the HOSTS file (<IPAddress_I_want> <machine_name>), other bits
of voodoo. So far, nothing has worked. Nobody I have talked with hsa
been able to help me. Any ideas out there?
Thanks
- Tony H.
(target). Each of the two NICs on this target is assigned at least one
static IP address (not using DHCP). Only one of these NICs will
connect with an external computer (the other igoes to another internal
single board computer).
I have to run a 3rd-party application on this target that creates a set
of Windows sockets for users to interface with it. To connect to these
sockets, I must know (at compile time) what IP address those sockets
are going to bind to. Also, applications external to the target must
be able to connect to these sockets, so they too must know the IP
address in advnace.
It appears that the 3rd-party application is using gethostbyname() to
determine which IP Address it binds its sockets to. The troubling part
is that I have seen it bind to different IP addresses when run on
identical processor cards.
I know this is probably not a standard use of network facilities,
but it's what I'm stuck with.
Q: In a multi-homed system, how can I configure which IP address is
used to resolve the system's response to gethostbyname()?
I have tried re-adding the IP address in different order, adding an
entry in the HOSTS file (<IPAddress_I_want> <machine_name>), other bits
of voodoo. So far, nothing has worked. Nobody I have talked with hsa
been able to help me. Any ideas out there?
Thanks
- Tony H.