|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
Network.Connection
public class Connection
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
private GameField |
gameField
|
private int |
id
|
private java.io.BufferedReader |
in
|
private java.io.BufferedWriter |
out
|
private java.net.Socket |
socket
|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
Connection(GameField gameField,
java.net.InetAddress address,
int port)
Constructeur utilisé par le client |
|
Connection(GameField gameField,
java.net.Socket socket)
Constructeur utilisé par le serveur |
|
| Method Summary | |
|---|---|
void |
close()
|
GameField |
getGameField()
Get the value of gameField |
int |
getid()
Get the value of id |
java.io.BufferedReader |
getIn()
Get the value of in |
java.io.BufferedWriter |
getOut()
Get the value of out |
java.net.Socket |
getSocket()
Get the value of socket |
void |
run()
Ecoute sur le flux d'entrée et transfert les données au gameField (méthode receiveData() ) |
void |
send(java.lang.String data)
Envoie la chaine data sur le flux de sortie |
void |
setGameField(GameField value)
Set the value of gameField |
void |
setid(int id)
Set the value of id |
void |
setIn(java.io.BufferedReader value)
Set the value of in |
void |
setOut(java.io.BufferedWriter value)
Set the value of out |
void |
setSocket(java.net.Socket value)
Set the value of socket |
| 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 GameField gameField
private int id
private java.io.BufferedReader in
private java.io.BufferedWriter out
private java.net.Socket socket
| Constructor Detail |
|---|
public Connection(GameField gameField,
java.net.InetAddress address,
int port)
throws java.io.IOException
address - Adresse du serveurport - Port d'écoute du serveur
java.io.IOException - possible lors de l'ouverture des flux d'E/S
public Connection(GameField gameField,
java.net.Socket socket)
throws java.io.IOException
gameField - socket - Socket de dialogue
java.io.IOException - possible lors de l'ouverture des flux d'E/S| Method Detail |
|---|
public void close()
public GameField getGameField()
public int getid()
public java.io.BufferedReader getIn()
public java.io.BufferedWriter getOut()
public java.net.Socket getSocket()
public void run()
run in interface java.lang.Runnablerun in class java.lang.Threadpublic void send(java.lang.String data)
data - public void setGameField(GameField value)
public void setid(int id)
public void setIn(java.io.BufferedReader value)
public void setOut(java.io.BufferedWriter value)
public void setSocket(java.net.Socket value)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||