public class Client extends Observable implements Runnable
Runnable
Constructor and Description |
---|
Client()
Create a new client
|
Modifier and Type | Method and Description |
---|---|
void |
run()
Running thread
|
void |
sendToServer(Socket sock)
Method that when changes occurred on cells of client's share, listener
changes a flag value and this method can run and send that update to the
server
|
void |
startClient(Connections connection,
Cell cellStart,
Observer observer,
String password)
Method that will start the client and receive cells throw network
|
void |
startClient(String IP,
int port,
Cell cellStart,
String password,
Observer observer)
Method that will start the client and receive cells throw network
|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
public Client()
public void startClient(String IP, int port, Cell cellStart, String password, Observer observer)
IP
- the server ipport
- the connection port of the servercellStart
- cell where we paste the content of the shared cellspassword
- the connection passwordobserver
- the observer classpublic void startClient(Connections connection, Cell cellStart, Observer observer, String password)
connection
- the connection to the servercellStart
- cell where we paste the content of the shared cellsobserver
- the observer classpassword
- the password connectionpublic void sendToServer(Socket sock) throws IOException, InterruptedException
sock
- the client socketIOException
- of a I/O exception occursInterruptedException