public class ServerThread extends Thread
UFTPTransferRequest
instances, and waits
for connection attempts from clients. For each connection attempt, it is
checked whether a matching job exists.Thread.State, Thread.UncaughtExceptionHandler
Modifier and Type | Field and Description |
---|---|
static long |
MAX_JOB_AGE_DEFAULT |
long |
maxJobAge |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
ServerThread(InetAddress ip,
int port,
int backlog,
int maxStreams,
String advertiseAddress,
PortManager pm)
create a new server thread
|
Modifier and Type | Method and Description |
---|---|
void |
addJob(UFTPTransferRequest job)
adds job
|
void |
checkForExpiredJobs()
check if "zombie" jobs exist and clean them up
|
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 |
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 static final long MAX_JOB_AGE_DEFAULT
public final long maxJobAge
public ServerThread(InetAddress ip, int port, int backlog, int maxStreams, String advertiseAddress, PortManager pm) 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(UFTPTransferRequest job)
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 notifyConnectionClosed(InetAddress client)
client
- public void halt()
public void checkForExpiredJobs()
public void cleanConnectionCounters()
public FileAccess getFileAccess()
Copyright © 2010–2016 UNICORE. All rights reserved.