more benchmarks from Danish Lakhani and Jason Jung's EECS 221 Project
[IRC.git] / Robust / src / Benchmarks / BankAppJava / BankAppTestClient.java
diff --git a/Robust/src/Benchmarks/BankAppJava/BankAppTestClient.java b/Robust/src/Benchmarks/BankAppJava/BankAppTestClient.java
new file mode 100644 (file)
index 0000000..a2cc7f1
--- /dev/null
@@ -0,0 +1,48 @@
+// Bank App in Java
+
+// Author: Danish Lakhani
+
+import java.io.*;
+import java.net.*;
+
+class BankAppTestClient
+{
+       public static void main(String [] args)
+               throws IOException
+       {
+               BufferedReader local_in = new BufferedReader(new InputStreamReader(System.in));
+               String sendline;
+
+               System.out.println("Client");
+
+               sendline = local_in.readLine();
+if (sendline == null)
+       sendline = "localhost";
+               System.out.println("Connecting to server...");
+               Socket mySocket = new Socket(sendline, 8000);
+
+               System.out.println("Connected!!");
+               
+               PrintWriter out = new PrintWriter(mySocket.getOutputStream(), true);
+               BufferedReader in = new BufferedReader(new InputStreamReader(mySocket.getInputStream()));
+               
+
+               
+               while (true)
+               {
+                       System.out.print("Send: ");
+                       sendline = local_in.readLine();
+
+                       if (!sendline.equals("no"))
+                       {
+                               out.println(sendline);
+                       }
+                       else
+                       {
+                               System.out.print("Reading: ");
+                               String inString = in.readLine();
+                               System.out.println(inString);
+                       }
+               }
+       }
+}