public class ServerThread extends Thread
UFTPBaseRequest
instances, and waits
for connection attempts from clients. For each connection attempt, it is
checked whether a matching job exists.Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
ServerThread(InetAddress ip,
int port,
int backlog,
int maxStreams,
String advertiseAddress,
PortManager pm,
boolean checkClientIP)
create a new server thread
|
Modifier and Type | Method and Description |
---|---|
void |
addJob(UFTPBaseRequest job) |
void |
cleanConnectionCounters() |
void |
close()
shut down the server
|
int |
getBufferSize() |
FileAccess |
getFileAccess() |
String |
getHost() |
int |
getMaxControlConnectionsPerClient() |
int |
getPort() |
int |
getTimeout()
return the server timeout
|
void |
halt() |
void |
notifyConnectionClosed(InetAddress client)
a connection to the given client was closed
|
void |
run()
while not halted, new connections are accepted and processed
asynchronously using a thread pool
|
void |
setBufferSize(int bufferSize) |
void |
setCheckClientIP(boolean checkIP) |
void |
setMaxControlConnectionsPerClient(int maxControlConnectionsPerClient) |
void |
setMaxStreamsPerConnection(int maxStreams) |
void |
setTimeout(int time)
set the timeout for accepting new connections
|
activeCount, 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, yield
public ServerThread(InetAddress ip, int port, int backlog, int maxStreams, String advertiseAddress, PortManager pm, boolean checkClientIP) throws IOException
ip
- - server IP addressport
- - server listen portbacklog
- - server socket backlogmaxStreams
- - maximum number of TCP streams per transferIOException
public void run()
public void addJob(UFTPBaseRequest job)
public void close() throws IOException
IOException
public void setTimeout(int time)
time
- Timeout in mspublic int getTimeout()
public int getPort()
public String getHost()
public int getMaxControlConnectionsPerClient()
public void setMaxControlConnectionsPerClient(int maxControlConnectionsPerClient)
public void setMaxStreamsPerConnection(int maxStreams)
public int getBufferSize()
public void setBufferSize(int bufferSize)
public void setCheckClientIP(boolean checkIP)
public void notifyConnectionClosed(InetAddress client)
client
- public void halt()
public void cleanConnectionCounters()
public FileAccess getFileAccess()
Copyright © 2010–2018 UNICORE. All rights reserved.