public class NetConfHelper
extends java.lang.Object
implements java.lang.Runnable
Constructor and Description |
---|
NetConfHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] args)
Runs either the server part or the client part.
|
void |
run()
Server part activity
|
void |
startServer(java.net.InetSocketAddress localAddr)
Start the server part.
|
void |
stopServer()
Stop the server part
|
static java.net.InetAddress |
tryAddresses(java.lang.String ip,
int port,
int timeout_ms)
Submit all IP addresses of locally configured network interfaces to
the server part.
|
public static void main(java.lang.String[] args) throws java.lang.Exception
args
- two forms:
java.lang.Exception
- either the provided arguments are not correct, or the
server part could not be started because of a network-related problem
(e.g. it can't bind to the provided IP address/port).public static java.net.InetAddress tryAddresses(java.lang.String ip, int port, int timeout_ms)
ip
- the IP address of the configuration helper's server partport
- the port number of the configuration helper's server parttimeout_ms
- the time-out value waiting for a reply from the server
after having submitted an IP address.public void startServer(java.net.InetSocketAddress localAddr) throws ClifException
localAddr
- the local IP address and port to bind to.ClifException
- the server part of the configuration helper could not be started.public void stopServer() throws ClifException
ClifException
- problem while trying to close the server socketpublic void run()
run
in interface java.lang.Runnable