aboutsummaryrefslogtreecommitdiff
path: root/CS2452/chatThreaded/ChatClient.java
diff options
context:
space:
mode:
Diffstat (limited to 'CS2452/chatThreaded/ChatClient.java')
-rw-r--r--CS2452/chatThreaded/ChatClient.java40
1 files changed, 40 insertions, 0 deletions
diff --git a/CS2452/chatThreaded/ChatClient.java b/CS2452/chatThreaded/ChatClient.java
new file mode 100644
index 0000000..1822240
--- /dev/null
+++ b/CS2452/chatThreaded/ChatClient.java
@@ -0,0 +1,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();
+ }
+ }
+}