|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
common.StoppableThread
common.TransfertSlave
server.core.TCPListener
public class TCPListener
Implémente le serveur TCP.
Lors de la création, un serveur TCP est démarré sur le port spécifié. Lorsque le thread représenté par cette classe est démarré, le serveur accepte alors les connexions TCP.
Lorsqu'une nouvelle connexion est établie, la connexion TCP est transmise en argument à un nouveau gestionnaire de transfert qui gère ensuite l'initialisation puis le démarrage du transfert.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
private ServerScheduler |
scheduler
Ordonnanceur du serveur. |
private ServerSocket |
tcpSocket
Socket TCP. |
| Fields inherited from class common.TransfertSlave |
|---|
master |
| Fields inherited from class common.StoppableThread |
|---|
quitQuery |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
TCPListener(TransfertMaster master,
ServerScheduler scheduler,
int tcpPort)
Initialise un socket UDP sur le port tcpPort. |
|
| Method Summary | |
|---|---|
protected void |
doFree()
Libère les ressources en fermant le socket TCP. |
void |
doQuit()
Prends les dispositions pour que le thread termine en fermant le socket TCP. |
void |
run()
Méthode principale du thread. |
| Methods inherited from class common.StoppableThread |
|---|
free, quit |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, 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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private final ServerScheduler scheduler
private final ServerSocket tcpSocket
| Constructor Detail |
|---|
public TCPListener(TransfertMaster master,
ServerScheduler scheduler,
int tcpPort)
throws SocketStartFailure
tcpPort. Le socket
ainsi créé n'accepte aucune connexion, il faut démarrer le thread pour
que celui-ci accepte les nouvelles connexions.
master - objet maître.scheduler - ordonnanceur du serveur.tcpPort - port TCP.
SocketStartFailure - s'il est impossible de créer un socket sur le port spécifié.| Method Detail |
|---|
protected void doFree()
doFree in class StoppableThreadThread.run(),
StoppableThread.isFree,
StoppableThread.free()public void doQuit()
doQuit in class StoppableThreadThread.run(),
StoppableThread.quitQuery,
StoppableThread.quit()public void run()
run in interface Runnablerun in class Thread
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||