Package com.ed.edcom
Class ClientFactory
java.lang.Object
com.ed.edcom.ClientFactory
- All Implemented Interfaces:
Closeable
,AutoCloseable
Client factory.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add new clientvoid
close()
Closes all clients.Get active clientsstatic Client
getClient
(InetAddress hostIp, InetAddress devIp, int delay) Client factoryGet address for current interfaceGet visible active clientsstatic void
printNetworkInterfaces
(boolean all) Print available TCP/IP interfacesvoid
start()
Start all clients
-
Constructor Details
-
Method Details
-
getClient
Client factory- Parameters:
hostIp
- local host IP address related to desired networkdevIp
- device IP addressdelay
- start communication after delay [ms]- Returns:
- communication object
- Throws:
Exception
- error
-
addClient
Add new client- Parameters:
cl
- new client
-
start
public void start()Start all clients -
close
Closes all clients.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
- according to interface definition
-
printNetworkInterfaces
public static void printNetworkInterfaces(boolean all) Print available TCP/IP interfaces- Parameters:
all
- true - print all, false - print active interfaces only.
-
getHostAddress
Get address for current interface- Returns:
- host IP
-
getActiveClients
Get active clients- Returns:
- client list
-
getVisibleActiveClients
Get visible active clients- Returns:
- client list
-