Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

specify outgoing port for udp packets

843790Sep 17 2009 — edited Sep 17 2009
I'm working on a program that will be run on a Linux box with two Ethernet ports. Each port will be connected to a different router and thus each port can only access half the clients that will be communicating with us. This means that when we send UDP packets out to a client we must make sure that the packets go out of the right ethernet device. If we send to TCP address of client 1 using Ethernet B we will fail because Ethernet B is connected to a different router and can't access client 1.

I can and have configured the OS previously to get around this difficulty. The problem is my team will ultimately not control the environment our program is run in. Is there a way from within java to specify what outgoing IP address and/or device to send packets out of so they are delivered to the correct router?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 15 2009
Added on Sep 17 2009
1 comment
243 views