From b4dbd2cfa724476162fa6d35941a5d7cdc9c9524 Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Mon, 18 Feb 2019 08:10:10 -0500 Subject: Adds all assignments not previously in a git repo --- CS2452/chatThreaded/ChatClient.java | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 CS2452/chatThreaded/ChatClient.java (limited to 'CS2452/chatThreaded/ChatClient.java') 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(); + } + } +} -- cgit v1.1