net.tomp2p.connection
Class DiscoverNetworks

java.lang.Object
  extended by net.tomp2p.connection.DiscoverNetworks

public class DiscoverNetworks
extends Object

A class to search for addresses to bind the sockets to. The user first creates a Bindings class and provides all the necesary information, then calls discoverInterfaces(Bindings). The results are stored in Bindings as well.

Author:
Thomas Bocek

Constructor Summary
DiscoverNetworks()
           
 
Method Summary
static String discoverInterfaces(Bindings bindings)
          Search for local interfaces.
static String discoverNetwork(NetworkInterface networkInterface, Bindings bindings)
          Discovers network interfaces and addresses.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiscoverNetworks

public DiscoverNetworks()
Method Detail

discoverInterfaces

public static String discoverInterfaces(Bindings bindings)
                                 throws IOException
Search for local interfaces. Hints how to search for those interfaces are provided by the user through the Bindings class. The results of that search (InetAddress) are stored in Bindings as well.

Parameters:
bindings - The hints for the search and also the results are stored there
Returns:
The status of the search
Throws:
IOException - If anything goes wrong, such as reflection.

discoverNetwork

public static String discoverNetwork(NetworkInterface networkInterface,
                                     Bindings bindings)
Discovers network interfaces and addresses.

Parameters:
networkInterface - The networkInterface to search for addresses to listen to
bindings - The search hints and result storage.
Returns:
The status of the discovery


Copyright © 2013. All Rights Reserved.