Results 1 to 2 of 2
  1. #1
    mr_anderson is offline Member
    Join Date
    May 2010
    Rep Power

    Default binding a java program to a specific networkcard

    how can I bind a java application to a specific LAN (in case you have more than one network card on your computer), my problem is that I have two LANs on my computer each connected to a different network and I am developing a java application which should communicate with one of the networks, the problem is that when the two LANS are ON the java application gets confused some times and simply donot connect, but when i turn the unwanted LAN (i.e. keeps only one LAN working) every thing works fine so I think if i bind the java application to the desired LAN I can work with both LANs ON, any ideas about binding a java program to use a specific LAN.
    (NOTE: one of the LANs is connected to a local network while the other is connected to the Internet).

  2. #2
    Jononomous is offline Member
    Join Date
    Mar 2008
    Rep Power


    Not so much to the card itself as to the IP Address that it's subject to. Using java's socket api you could do something such as...

    Java Code:
    InetSocketAddress addy = new InetSocketAddress("", 9000);
    ServerSocket s = new ServerSocket();
    And this would bind it to whatever card is using ""
    DHCP Reservation is your friend!


    - Jon

Similar Threads

  1. Replies: 0
    Last Post: 05-04-2010, 11:10 PM
  2. How to assigne Java thread to a specific cpu core
    By perl0101 in forum Advanced Java
    Replies: 3
    Last Post: 02-03-2010, 10:39 AM
  3. Link to specific part of a Java Servlet
    By jwilley44 in forum Java Servlet
    Replies: 2
    Last Post: 02-03-2009, 02:51 AM
  4. Replies: 2
    Last Post: 11-08-2008, 11:40 AM
  5. Custom XML to Java Type Binding using JAXB
    By surajkumar in forum XML
    Replies: 0
    Last Post: 09-02-2008, 01:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts