public abstract class DistributedServer extends com.daioware.net.socket.GenericTCPServer implements Iterable<TcpActiveMachine>
Thread.State, Thread.UncaughtExceptionHandlercurrentRunningThreads, servSocketMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
DistributedServer(DistributedServerConfig config) |
DistributedServer(com.daioware.net.socket.UDPElement udpElement,
com.daioware.net.socket.TCPServSocket servSocket,
com.daioware.stream.Printer printer,
int maxSimultaneousConnections) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(TcpActiveMachine a) |
void |
announcePresence() |
protected void |
begin() |
void |
close() |
TcpActiveMachine |
get(String addr) |
TcpActiveMachine |
getActiveMachineWithBetterAvailableConnections() |
protected Thread |
getNewClientThread(com.daioware.net.socket.TCPClientSocket clientSocket) |
abstract Runnable |
getRunnable(com.daioware.net.socket.TCPClientSocket clientSocket) |
com.daioware.net.socket.UDPElement |
getUdpElement() |
protected void |
initialize() |
boolean |
isAnnouncePresence() |
Iterator<TcpActiveMachine> |
iterator() |
protected boolean |
readyToCloseLog() |
TcpActiveMachine |
remove(String addr) |
void |
sendCurrentConnections() |
void |
setUdpElement(com.daioware.net.socket.UDPElement udpElement) |
addSession, decrementRunningThreads, getCurrentConnections, getMaxSimultaneousConnections, getPrinter, getServSocket, incrementRunningThreads, isActive, print, println, removeSession, removeSession, run, setActive, setCurrentRunningThreads, setMaxSimultaneousConnections, setPrinter, setServSocketactiveCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic DistributedServer(com.daioware.net.socket.UDPElement udpElement,
com.daioware.net.socket.TCPServSocket servSocket,
com.daioware.stream.Printer printer,
int maxSimultaneousConnections)
public DistributedServer(DistributedServerConfig config) throws UnknownHostException, IOException
UnknownHostExceptionIOExceptionprotected void initialize()
public void announcePresence()
public boolean isAnnouncePresence()
public com.daioware.net.socket.UDPElement getUdpElement()
public void setUdpElement(com.daioware.net.socket.UDPElement udpElement)
public TcpActiveMachine get(String addr)
public TcpActiveMachine remove(String addr)
public boolean add(TcpActiveMachine a)
public TcpActiveMachine getActiveMachineWithBetterAvailableConnections()
protected Thread getNewClientThread(com.daioware.net.socket.TCPClientSocket clientSocket)
getNewClientThread in class com.daioware.net.socket.GenericTCPServerpublic abstract Runnable getRunnable(com.daioware.net.socket.TCPClientSocket clientSocket)
getRunnable in class com.daioware.net.socket.GenericTCPServerpublic Iterator<TcpActiveMachine> iterator()
iterator in interface Iterable<TcpActiveMachine>protected void begin()
begin in class com.daioware.net.socket.GenericTCPServerpublic void sendCurrentConnections()
protected boolean readyToCloseLog()
public void close()
throws IOException
close in class com.daioware.net.socket.GenericTCPServerIOExceptionCopyright © 2017. All rights reserved.