summaryrefslogtreecommitdiff
path: root/src/ChatClient.java
blob: 53a6e815c4ed102e2feb0d02629dfa521d2d4497 (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
import java.io.*;
import java.net.Socket;
import java.util.*;

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();
	}

}