blob: 458c19d5e07c739728f02255b4f6bfa8fe9158fa (
plain)
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
|
package Client;
import java.io.*;
import java.net.Socket;
import java.util.*;
import Server.ChatServer;
public class ChatClient
{
public static void main(String[] args) throws IOException
{
int port = ChatServer.portNum;
String host = null;
Socket soc;
try
{
soc = new Socket(host, port);
} catch (IOException e)
{
System.err.println("Failed connecting to server: " + host + ":" + port + " (" + e + ")");
return;
}
ChatClientReader reader = new ChatClientReader(soc);
ChatClientWriter writer = new ChatClientWriter(soc);
reader.start();
writer.start();
//soc.close();
}
}
|