net.tomp2p.connection
Class DiscoverNetworks
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DiscoverNetworks
public DiscoverNetworks()
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 tobindings
- The search hints and result storage.
- Returns:
- The status of the discovery
Copyright © 2013. All Rights Reserved.