-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClient.java
More file actions
executable file
·49 lines (38 loc) · 972 Bytes
/
Client.java
File metadata and controls
executable file
·49 lines (38 loc) · 972 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package Client;
import java.net.Socket;
/**
* Created by amirpez on 11/11/17.
*/
public class Client implements ImpClient {
Socket clientSocket;
public MultithreadedClient clientThread;
@Override
public void startClient() {
try
{
this.clientSocket = new Socket("192.168.1.101",7001);
this.clientThread = new MultithreadedClient(clientSocket,this);
clientThread.start();
}
catch (Exception e)
{
}
}
public MultithreadedClient getClientThread(){
return clientThread;
}
// private void listenForInput(String input){
// while (true)
// {
// clientThread.sendStringToServer(input);
// }
// clientThread.close();
// }
@Override
public void sendToServer(String text) {
clientThread.sendStringToServer(text);
}
public void closeStreams() {
clientThread.close();
}
}