aboutsummaryrefslogtreecommitdiff
path: root/CS2452/assign5/src/Client.java
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-02-18 08:10:10 -0500
committerTucker Evans <tuckerevans24@gmail.com>2019-02-18 08:10:10 -0500
commitb4dbd2cfa724476162fa6d35941a5d7cdc9c9524 (patch)
tree431af0b75efa29dfa3bab2868a78ab0eb29173c7 /CS2452/assign5/src/Client.java
parente8b1808eaf87a49e4c34ebbfb66854baa627418c (diff)
Adds all assignments not previously in a git repo
Diffstat (limited to 'CS2452/assign5/src/Client.java')
-rwxr-xr-xCS2452/assign5/src/Client.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/CS2452/assign5/src/Client.java b/CS2452/assign5/src/Client.java
new file mode 100755
index 0000000..9d7cb19
--- /dev/null
+++ b/CS2452/assign5/src/Client.java
@@ -0,0 +1,32 @@
+import java.net.*;
+import java.io.*;
+
+class Client
+{
+ public static void main(String[] args)
+ {
+ try
+ {
+ byte b = 0;
+ int cnt = 0;
+ Socket s = new Socket(args[0], Integer.parseInt(args[1]));
+ DataInputStream di = new DataInputStream(s.getInputStream());
+ while (true)
+ {
+ b = di.readByte();
+ System.out.printf("%d - %d\t%x\t%c\n", ++cnt, b, b, b);
+ if ((cnt % (1024 * 1024)) == 0)
+ {
+ System.out.println("------MILLION------\n\n");
+ cnt = 0;
+ Thread.sleep(1000);
+ di.close();
+ return;
+ }
+ }
+ } catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+} \ No newline at end of file