bind to a specific IP address

R

Roger Jansen

I want to create a UDP socket that receives broadcast messages only from
a specific network device (in case there are more than one network
devices).

When I bind the socket to INADDR_ANY I receive all messages, but when I
bind to a specific IP address, no broadcast messages are received at all
on IRIX or Linux. On Windows2K it works like I expected.

I still have to test it on a Unix machine with two network cards, but I
think binding to a specific address should work also with only one.

Note that when I use INADDR_ANY on Windows with two network cards each
connected to a seperate network, I receive each message twice on the
same socket!! That's why INADDR_ANY in combination with different UDP
ports for both netwoks is not an option.

Does anyone has experience with multiple network devices??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
SterlingLa
Top