aboutsummaryrefslogtreecommitdiff
path: root/CS2452/chatThreaded/ChatClient.java
blob: 18222401fef88386fd5b7a339f8a0d96925fe1a4 (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
37
38
39
40
import java.util.*;
import java.io.*;
import java.net.*;



class ChatClient
{
	public static void main(String[] args)
	{
		Socket s;
		InetAddress address = null;
		int port = 0;
		
		

		try
		{
			address = InetAddress.getByName(args[0]);
			port = Integer.parseInt(args[1]);
			}catch (UnknownHostException ex){
			ex.printStackTrace();
		}		
	
		try
		{
			s = new Socket(address, port);

			T1 screenWriter = new T1(s);
			T2 socketWriter = new T2(s);
			screenWriter.start();
			socketWriter.start();

		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
	}
}