Arya
Arya

Reputation: 8985

Two network cards, choose which to use with each Java application?

I have a pc with two network cards, I do web testing using htmlunit, is there anyway to run 2 htmlunit instances and pick which instance uses which network card?

Regards!

Upvotes: 0

Views: 170

Answers (1)

Jim Garrison
Jim Garrison

Reputation: 86764

When binding to a client socket or opening a server socket, specify an explicit local IP address to choose the adapter. The java.net.NetworkInterface API provides methods to enumerate adapters and get their IPs

Upvotes: 1

Related Questions