Java: Need to have TWO sockets listening to UDP broadcasts on the same port, how?
Posted on 2004-10-19
I am NOT a Java newbie, but this has stumped me.
DO NOT ATTEMPT TO TELL ME I SHOULD BE DOING SOMETHING ELSE -- I don't have the time to explain why I need to do what i'm asking, but trust me, I need to.
I need to be able to have two DatagramSockets listening to UDP broadcasts on the **SAME PORT**, on the same machine. However, this just doesn't seem possible (can only bind one). How can it be done?
For instance, if I try and have some relaying going on, it still doesn't work: as soon as you bind something to wildcard port X (0.0.0.0 port X), you can't even then bind something to a specific IP, port X ! (ie. 0.0.0.0 port X and 10.101.1.5 port X). This rules out having the first person to bind to 0.0.0.0 port X then passing on the packet to the other processes (they'd all have to be on a different port, bah, confusing)