aboutsummaryrefslogtreecommitdiff
path: root/CS2452/assign5/src/Client.java
diff options
context:
space:
mode:
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