ServerSocket with multiple NIC

I need? (want!) to write a server type application that will listen to requests that arrive via 2 (or more) NICs.
My problem is that the program seems to ignore the second card.
OK some code...
waiter1= new Waiter("123.456.789.12");
waiter1.start();
waiter2= new Waiter("234.567.890.123");
waiter2.start();
class Waiter extends Thread{
private String IPaddress;
public Waiter(String IPAddress){
this.IPAddress=IPAddress;
public void run(){
System.out.println((NetworkInterface.getByInetAddress(InetAddress.getByName(IPAddress)).getName())
ServerSocket sSocket=new ServerSocket(1234,0,InetAddress.getByName(IPAddress));
while(forever){
Cover cover=new Cover(sSock.accept());
cover.start();
class Cover extends Thread{
private Socket sock;
public Cover(Socket sock){
this.sock=sock;
public void run(){
// do all the usefull stuff
it gives the right system output, ie..
eth0
eth1
requests are handled ok on the first IP addy, but not on the second.
Ive seen a bug report relating to MultiCast sockets (seems like the argument is ongoing), but nothing about ServerSockets
btw the code is a transcript, working version compile s and runs :-)

Well.. if you want to listen to anything on any nic you could just start a ServerSocket on a port only...
is there anything else listening on the second IP at port 1234? or whichever port you're using?
put try / catch / e.printStackTrace() around where you're creating the serversocket so you can see if the socket is actually available..
if you don't like the first approach, the accept() method of a single serverSocket can be "listened" to by as many threads as you want... so you can still have it multithreaded
ah and the address "0.0.0.0" essentially means all available IP's ... so if you create a serversocket on "0.0.0.0" port 80 you'll recieve everything going to port 80

Similar Messages

  • WOL question. SCCM server with multiple nics.

    Hi,
    I have a sccm server with multiple nics, I can wake up any machine using a 3ed party magic packet utility, if I set a schedule and use sccm wol functionally the machine never wakes up. As I pointed out my server has multiple nics, does anyone have a sccm
    server with multiple nics with sccm built in wol functionally working?. I am curious on how you achieved this.

    Hey Garth,
    Yes the problem is solved but we had to buy a 3rd party power management utility to accomplish WOL. Because we have many different subnets in our environment we found that this was the fastest way to get WOL working,
    So out of the box SCCM would not work for us, with a 3rd party utility that had an SCCM plugin WOL now works flawlessly.

  • DataSocket fails intermittently with multiple NICs enabled using LV7.1

    Using LV7.1 and Datasocket v4.2, I was intermittently (but quite often) having problems reading and writing to the datasocket server (primarily from the server side). My application should read the value in the item and upon finding a specific string it should immediately follow it with a write of a default string. However, it can find the same string multiple times and not complete the write. Logging the errors from the write shows that no error is occurring. The client is not at fault because it only writes the string once every few minutes. I was able to finally show that by disabling the extra NIC on my system running the datasocket server that the connection seems to operate reliably. Both NICs
    were set to static IP addresses, but only one was connected. I do have the program writing to "dstp://localhost/UUT" as opposed to a specific IP address (not sure if it matters).
    With Labview6.1 I did not have this problem. It was only after I re-compiled my application with LV7.1 that I started having issues.

    Philip,
    I do not feel I am running out of bandwidth since I have run it successfully on 1Gbit NIC connections on a P4 2.4GHz system as well as a 10/100Gbit NIC on an old 650MHz system with LV6.1. I only do two writes per variable (on up to 8 variables) once every few minutes. I did not seem to be a re-entrant VI issue.
    I have created two VIs which should allow you to recreate the failing conditions with multiple NICs enabled. It responds very quickly with one NIC enabled, but when one or two more NICs is enabled, it gets very slow to respond and has some timeouts.
    One VI is the writer, the other is the reader. Start both VIs and start all 8 reader loops. Then you can consecutive
    ly click on all 8 sender loops. Doing this with and without multiple NICs enabled should show you the problem.
    Note: I think the issue I was talking about in earlier posts about getting multiple strings back before it wrote out "Loop" was due to the fact that the writes were not occurring quickly enough and the reads were happening multiple times. Therefore, in these VIs, I revised the read and close timeouts to -1.
    I think it would be best if you could call me so we can discuss this issue. If you can email me, I will send you my contact information if you don't already have access to it.
    Attachments:
    ReadSocket_Multiple_MSHv1.vi ‏360 KB
    WriteSocket_Multiple_MSHv1.vi ‏216 KB

  • Bonjour not finding anything from PC with Multiple NICs

    We have two Network Interface Cards in each workstation at work to access two separate Physical Networks. Both networks provide access to ZeroConf (Bonjour) IP Printers.
    Bonjour discovery fails intermittently on the two different networks. Occasionally Printers on one network, the other network, both or neither are visible from various workstations.
    Is mDNSResponder aware of multiple NICs? Is there a way to force mDNSResponder to only search for printers on a particular subnet?

    The second  network adapter was installed after the VPC, indeed.
    In the dropdown menu in the VPC networking settings there was only one network adapter to chose because the description for both physical network cards were the same. Therefore I cannot assign for virtual NICs different physical network adapters.
    Finally I coped with the problem:
    - I uninstalled one of the adapters (removing the drivers, too),
    - edited the INF file in the adapter drivers and changed the description of the adapter
    - I reinstalled the adapter with the altered driver (with the INF file changed).
    Then, in the VPC networking settings both physical adapters appeared (one with the altered description).
    I Wonder if that will cause any problems later ;)
    Thanks for your replies :)

  • Vm with multiple nic

    Most of the time I only add a second vNIC to multi-hone the VM so it can connect to two different subnets (i.e. one vNIC for backup traffic connected to a different vSwitch with different physical uplink than all connections for production VM traffic).
    As Rod said, it may prove more beneficial to only have one vNIC unless you somehow have so much traffic that the one vNIC is overloaded.  What version of VMWare are you running?  

    We have a switch with multiple vmmic (five), Is there any advantages os using multiple nic for vm to improve network performance ?
    This topic first appeared in the Spiceworks Community

  • Weblogic Cluster on a machine with multiple NIC

    Out Setup
              One Quad Machine
              2 NIC - one ip address on each
              Two weblogic installations
              Each Instance is listening on one address and port 7001.(managed servers)
              Admin Server on one of the ip and port 8001
              Both managed servers part of a cluster.
              While i check weblogic console i see both the managed server
              having almost same number of frames incoming and outgoing.
              If i check 4 processers all 4 of them working eqaully same
              during out load test..(almost 85%)
              But i check NICs only one of them seems to be working really hard..
              and another one so..so.. what could be the problem??
              

              Weblogic 7 has a new concept called network channel, where there is a section talking
              about clustering over multiple NIC cards. I was confused by the cluster address in
              customized network channel (no example there). I tried to use multiple NIC cards
              for the purpose of network failover, but failed in clustering environment, although
              I succeed in single server environment.
              Kumar Allamraju <[email protected]> wrote:
              >You can set Interface address via admin console's
              >Cluster >> {Cluster Name }
              >
              >on the right hand side you will find InterfaceAddress box.
              >
              >--
              >Kumar
              >
              >zevit wrote:
              >
              >>>It's the JVM & OS who will take adv. of multiple NIC's. We don't have
              >>>anything in WLS that does this thing.
              >>>
              >>>Alternatively you can bind each WLS instance to a specific NIC card
              >>>to effeciently utilize each NIC card.
              >>>
              >>
              >> thank u kumar.. Could u please tell me how do i bind each WSL instance
              >> to a specific NIC ?
              >>
              >
              

  • Windows Server CNA with multiple NICs needed

    I have a Windows server in which I am teaming two CNA connections for Networking and Storage.  They are teamed using the Emulex teaming utility.  I want to set up a primary network and a backup network, but I cannot seem to edit the current
    configured team to allow for multiple connections.  Can anybody help out?

    Hi,
    To resolve your problem as soon as possible, please consult the teaming utility manufacturer about this issue.
    To configure NIC Teaming on Windows Server 2012R2, please follow the steps below,
    Click the server name in the list of servers (even if there is only a single server).
    From the Tasks drop-down menu in the
    Teams section, click New Team.
    In the Add Team dialog box, type a team name and select the network adapters in the team.
    If you are using VLANs, clear the Default check box and specify the VLAN ID. By default, the team will deliver up all traffic received regardless of VLAN ID (though the VLAN ID is passed with the packet so that
    other components in the stack can sort them appropriately).
    If you want to use a mode other than the default, click
    Advanced and specify the teaming mode (Switch Independent, Static Teaming, or LACP) and load distribution mode (Address Hash) as needed.
    Click OK to create the team.
    You can change the Active/Standby adapter in step 5
    For detailed information, please view the link below,
    NIC Teaming Overview
    http://technet.microsoft.com/en-us/library/hh831648.aspx
    Hope this helps.
    Steven Lee
    TechNet Community Support

  • Domain Agents and E6900 with multiple NICs.

    Hello,
    I have some issues configuring Sun management Center 3.6 (and 3.6.1) on a network with this characteristics:
    2 x E6900 (with 2 Domains each one)
    1 x v210
    The Server Component of Sun Management Center is installed on the v210. In this machine are installed the Platform Agents of the 2 System Controllers of the 2 E6900.
    Each domain has installed de Sun Management Center Agent.
    The network configuration of the Domains is this:
    Each domain has 3 NIC on 3 different network interfaces, and each NIC has its own hostname. One of this NIC is destinated to the administration network to be used for the Sun Management Center. This nic, as I said before, has its own hostname but it its different of the nodename (the node name is the same as the public interface of the domain, not the administration interface).
    The Domains does not use DNS, and the information included on the /etc/hosts is related to local NICs and the NICs of the other Domains, but anyone contains the NIC of the admin interface of other domain nor the NIC of the v210.
    The v210 does not has DNS neither, and has only their own information on /etc/hosts.
    All Domains has Solaris 9, and v210 has Solaris 10.
    Basically the problem is:
    "The Domain Agents cannot communicate with SunMC Server", when I manually add each agent. The discovery process doesn't work neither.
    I checked the domain-config.x of one domain and it shows:
    agent = {
    agentServer = "venwas1"
    logicalAddressMode = "ip"
    snmpPort = "1161"
    "venwas1" is the hostname of the public interface, nor the administration interface.
    I changed the value for the hostname of the administration interface with no success; then changed for the ip address of the administration interface; and no success neither.
    The default platform agent works, but does not appers with the corrent icon on the SunMC console. Its appears like a folder icon, and the documentation said that the Platform Agents is represented with a specific Icon.
    Please, anyone can help me ?
    Thanks in advance.

    Hi Alejandro,
    I checked the domain-config.x of one domain and it
    shows:
    agent = {
    agentServer = "venwas1"
    logicalAddressMode = "ip"
    snmpPort = "1161"
    nwas1" is the hostname of the public interface, nor
    the administration interface.
    I changed the value for the hostname of the
    administration interface with no success; then
    changed for the ip address of the administration
    interface; and no success neither.If you just change the hostname or IP, but don't do anything else, it won't work as the Agent has already created security keys for that old entry and needs to be reseeded. Change the entry to the IP that's on the same network as your SunMC Server, then run this command on the Agent while it's turned off:
    /opt/SUNWsymon/sbin/es-run base-usm-seed.sh -s <SEED> -c agent
    ..replacing <SEED> with the same seed/password you used on your SunMC Server. Then start the Agent back up, wait for it a couple minutes, and try to make an icon for it again.
    The default platform agent works, but does not appers
    with the corrent icon on the SunMC console. Its
    appears like a folder icon, and the documentation
    said that the Platform Agents is represented with a
    specific Icon.If the icon is incorrect then your SunMC Server is missing some files (or you've found a bug). You'll want all these addons installed on your Server:
    Dynamic Reconfiguration for Sun Fire High-End and Midrange Systems
    Sun Fire Midrange Systems Platform Administration
    Sun Fire Midrange Systems Domain Administration
    If you think you may be missing some (look in /var/opt/SUNWsymon/install/install.[timestamp] to see how you answered questions during your last install) you can run /opt/SUNWsymon/sbin/es-inst again and point it to your distribution media and it will only ask about packages that may be missing. If you do end up adding in some of the Midrange addons then a simple Console restart should refresh your Platform icons.
    Regards,
    [email protected]
    http://www.HalcyonInc.com

  • Connecting to AOP data store with multiple NIC's

    I have a situation where I need to have the computer running Diadem to be connected to two different networks.  I have two NIC's installed in the machine, NIC A and NIC B, we will call them.  The reason for this, is that I am using Diadem to access an AOP server on an AVL PUMA machine.  If I connect PUMA to the LAN, PUMA occasionally crashes, probably something to do with the IP address.  So, PUMA needs to be on a network that does not have a router.  My diadem computer needs to communicate with PUMA, and with the local shared drives on our company network.
    Anyway, I have the company LAN hooked up on NIC A, and the PUMA network hooked up on NIC B.  Diadem fails to connect when both networks are connected, but connects to the data store no problem when only the PUMA network is hooked up. Any ideas how to fix this?  It seems diadem is looking at NIC A instead of NIC B, like it should be. 
    For reference, when both NIC's are hooked up, I can access share drives, and ping computers on both separate networks, without a problem, so it's not a connection issue.
    Any help would be appreciated.
    -Russ
    Solved!
    Go to Solution.

    I assume poth NIC have different IP range.
    - Did you use IP instead of server name.
    - Do you use RPC or CORBA to access the PUMA server?
    - Which DIAdem version.
    Can you create a logfile when the connection fails?
    Greetings
    Andreas

  • Using authorized-hosts with multiple NICs

    I'm trying to limit cluster/grid membership using the authorized-hosts attribute, and I need to specify which Ethernet port is used when I start Coherence (or which one(s) to ignore). We have a "private" network setup that we want to run Coherence on, and the default NIC/port 0 is not part of that network.
    So I need to tell Coherence to use a specific port when it starts and not just the first IP port/address it finds. Is there a way to specify which NIC/IP address Coherence uses when it creates/joins the cluster?
    Following is the override file I place into tangosol-coherence-override.xml. This file is in the classpath before coherence.jar when i start my JVM.
    <?xml version='1.0'?>
    <!--
    This operational configuration override file is set up for use with Coherence in
    a development mode.
    -->
    <coherence xml-override="/tangosol-coherence-override.xml">
    <cluster-config>
         <authorized-hosts>
         <host-address id="1">172.16.1.1</host-address>
         <host-address id="2">172.16.1.2</host-address>
         <host-address id="3">172.16.2.1</host-address>
         <host-address id="4">172.16.2.2</host-address>
         </authorized-hosts>
    </cluster-config>
    </coherence>
    Thanks in advance for your help.
    Stacy Maydew

    Hi Stacy,
    it is possible to bind all Coherence traffic to a single network interface using the -Dtangosol.coherence.localhost=xxx.yyy.aaa.bbb and -Dtangosol.coherence.localport=xyzab which specifies which ip address and port to use for sending and receiving.
    Alternatively you can use an operational configuration override file which specifies the unicast-listener configuration element (see the link for more information).
    You may would also need to specify the -Djava.net.preferIPv4Stack Java property if your operating system/kernel also has IPv6 enabled and you want to use an IPv4 address, otherwise we saw packets lost due to them travelling on different interfaces.
    Best regards,
    Robert

  • ISE 1.2 - Multiple NICs/Load Balancing for DHCP Probe

    Hello guys
    Just prepping an ISE 1.2 patch 8 setup in our organization. I am going for the virtual appliances with multiple NICs. It will be a distributed deployment with 4 x PSNs behind a load balancer and there is no requirement for wireless or guest user at the moment. I've got 2 points I will like to get some guidance on:
    Our DC has a dedicated mgmt network and I plan to IP the gig0 interface of the PANs, MNTs and PSNs from this subnet. All device admin, clustering, config replication, etc will be over this interface. However, RADIUS/probe/other user traffic to the ISE PSNs will be over the gig1 interface which will be addressed from another L3 network. Is this a supported configuration in ISE?
    I intend to use the DHCP probe as part of device profiling and will ideally like to have just an additional ip helper to add to our switch SVI config. Also, it will appear that WLCs can only be configured for 2 DHCP servers for a given network so another consideration for when we bringing our WLAN in scope. We however use ACE load balancers within our DC and from what I have read, they do not support DHCP load balancing. Are there any workarounds to using the DHCP probe with multiple PSNs without having to add each node as an ip helper/DHCP server on the NADs?
    Thanks in advance
    Sayre

    Hello Sayre-
    For Question #1:
    Management is restricted to GigabitEthernet 0 and that cannot be changed so you should be good there
    You can configure Radius and Profiling to be enabled on other interfaces
    Even though you are not using guest services yet, you can dedicate an interface just for that. As a result, you can separate guest traffic completely from your production network
    Take a look at this link for more info:
    http://www.cisco.com/c/en/us/td/docs/security/ise/1-2/installation_guide/ise_ig/ise_app_c-ports.html
    For Question #2
    If you are using a Cisco WLC and running code 7.4 and newer you don't need to mess with the IP helper configurations. 
    The controller can be configured to act as a collector for client profiling and interact with the DHCP thread along with the RADIUS accounting task that is running on the controller. The controller receives a copy of the DHCP request packet sent from the DHCP thread and parses the DHCP packet for two options:
    –Option 12—HostName of the client
    –Option 60—The Vendor Class Identifier
    After this information is gathered from the DHCP_REQUEST packet, a message is formed by the controller with these option fields and is sent to the RADIUS accounting thread, which is in turn transmitted to the ISE in the form of an interim accounting message.
    Both DHCP and HTTP profiling settings are located under the "Advanced" configuration tab in the WLC
    On the other hand, you can also use Anycast for profiling. You can check out some of Cisco Live's sessions for more info on that. Here is one that is from a couple of years (There are more recent ones that are available as well):
    http://www.alcatron.net/Cisco%20Live%202013%20Melbourne/Cisco%20Live%20Content/Security/BRKSEC-3040%20%20Advanced%20ISE%20and%20Secure%20Access%20Deployment.pdf
    I hope this helps!
    Thank you for rating helpful posts!

  • Multiple nics on server

    Remote control will not work on server with multiple nics. Currently
    running Neware 5.1 with Zen 3.2. Zen 3.2 sp2 mentions this problem
    but I
    would rather not install sp2 if there is an easy fix. Any ideas?

    Mike,
    It appears that in the past few days you have not received a response
    to your posting. That concerns us, and has triggered this automated
    reply.
    Has your problem been resolved? If not, you might try one of the
    following options:
    - Do a search of our knowledgebase at
    http://support.novell.com/search/kb_index.jsp
    - Check all of the other support tools and options available at
    http://support.novell.com in both the "free product support" and "paid
    product support" drop down boxes.
    - You could also try posting your message again. Make sure it is
    posted in the correct newsgroup. (http://support.novell.com/forums)
    If this is a reply to a duplicate posting, please ignore and accept
    our apologies and rest assured we will issue a stern reprimand to our
    posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

  • Multiple NICs?

    Hey; can miggui handle source and target servers with multiple NICs/IP addresses? I have a DNS/DHCP server to migrate that services two separate VLANs, and I want to make sure I'm not going to blow the whole thing sky-high.
    Thanks.

    The Migration DHCP leases file issue has been fixed in the jumbo patch that just went into the oes2sp1 and sp2 updated channels a couple days ago. (bug 561928 - issue below).
    Steps to Reproduce:
    1. Setup NW server (6.5 SP 7 in this case)
    2. Setup OES server in the same tree. Remove edir replicas.
    3. Setup DHCP on both servers. NW should be configured with a range of 2
    address. OES should have the dhcp server setup.
    4. Run a windows client with one nic. Get a DHCP address and note the ip
    address given.
    5. Run the Novell Migration for DHCP (transfer ID option). Choose the
    server-level migration.
    6. Run the migration, and then run the post migration step per the
    documentation.
    7. Start DHCP on the OES box and watch the /var/log/messages. Restart or
    /release /renew the address from the client. It will not get the same address
    as before, but the second address in the pool. Drop the client and add a v-nic
    (if vmware), or have another client try and grab an address. The DHCP server
    will say it is out of leases, when in reality the first lease is not being
    honored.
    Actual Results:
    See above
    Expected Results:
    Expected the first client to get its original DHCP assigned address back,
    therefore leaving the remaining addresses in the pool open to new clients.

  • Multiple NIC Issues

    Hello everyone. I'm in the process of certifying a system with four dual-port gigabit ethernet ports. I can pass all tests with only one of those dual-port cards enabled, but when I have any more I fail the test.
    My question is has anybody had any luck with >2 NICS using the same driver? Specifically an Intel e1000g driver?
    -James

    Kevin, will this fix the problems with trying to do installations with
    multiple NICs, or is that still out there??
    "KBOYLE" <[email protected]> wrote in message
    news:[email protected]..
    >
    > The developers have apparently resolved this issue in an upcoming patch.
    > When the patch is applied you will be able to:
    >
    >
    > - Click on Advanced Settings to list all Network Interfaces.
    > - Select the radio button corresponding to the network interface you
    > would like simba to use
    > - Select/de-select network interfaces you do/do not want to be
    > touched.
    >
    > I don't know when the patch will be released into the channel. You will
    > know that the patch has been applied by checking from a terminal console
    > what revision of Simba is installed.
    > Code:
    > --------------------
    > server:~ # rpm -q simba
    > simba-2.5-r1921
    >
    > --------------------
    >
    >
    > --
    > Kevin Boyle
    > ------------------------------------------------------------------------
    > KBOYLE's Profile: http://forums.novell.com/member.php?userid=19359
    > View this thread: http://forums.novell.com/showthread.php?t=404451
    >

  • How can I merge all of the new FF windows that are open into one window with multiple tabs? Safari has a merge windows feature that I like. This is really nice when conducting reasearch on multiple sites at the same time.

    When I clik on weblinks they all open into new windows making it somewhat painful to clik on window in the menu bar to go to each new page. I would rather have a feature that would allow me to merge all of those individual windows into tabs within one page.
    == This happened ==
    Every time Firefox opened

    Thank you. That worked. I was able to open 1 window with multiple tabs. Thanks cor-el!

Maybe you are looking for

  • Runtime Error on Acrobat.exe.

    I am using Acrobat Professional version 8 on XP SP3.  It had always worked in the past but now, after opening, I get a Runtime error when trying to make a new PDF. Event Viewer gives: "Faulting application acrobat.exe, version 8.1.0.137, faulting mod

  • Downloaded song won't sync to iphone, needs to be converted

    I bought a song on iTunes and it downloaded to my iTunes, but it won't sync to my iPhone, the message states that the song needs to be converted.  How do I do that? Thanks Y

  • Problem exporting versions

    Anyone know why i can't export versions from aperture 2 on a new imac? Exporting masters is no problem; and I'm trying to export the versions in the same way, ie, file/export/version/s but the little dialogue box doesn't even appear for me to choose

  • KMZ (Google Earth) files on iWeb site

    I use MotionX GPS to record tracks of our trips. I then email the track to myself. This results in an attached KMZ file. Launching the file launches Google Earth and the track is nicely displayed with the start and finish pins at the top and bottom o

  • Interface Bug with 2 monitors in LP8

    I use 2 monitors tiled vertically to display a large track layout - in 7.2 I'd have to open the screenset and drag the window across to the 2nd screen - once I did this it would stay in place (across the 2 monitors) I LP 8 I tried the same thing - on