Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while ((line = reader.readLine()) != null)
- {
- output += line + "n";
- }
- if (clinetChoice.equals("3"))
- {
- String command = "free";
- Process process = Runtime.getRuntime().exec(command);
- BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
- System.out.println("You Chose Option Three");
- String line;
- while ((line = reader.readLine()) != null)
- {
- output += line;
- System.out.println(line);
- line = reader.readLine();
- }
- }
- while ((fromServer = input.readLine())+"n" != null)
- {
- System.out.println("Server: " + fromServer);
- if (fromServer.equals("Bye"))
- break;
- System.out.print("Enter your choice: ");
- fromClient = stdIn.readLine().trim();
- if(fromClient.equals("1"))
- {
- System.out.println("Client: " + fromClient);
- output.println(fromClient);
- }
- One
- Two
- Three
- Four
- One
- Enter your choice: (It prompts me for new command)
- Two
- Enter your choice:
- Three
- Enter your choice:
- Four
- One
- Two
- Three
- Four
- Enter your choice:
- String fromServer = "";
- String line;
- while ((line = input.readLine()) != null) {
- fromServer += line + "n"; // collect multiline strings into fromServer
- }
- System.out.println("Server: " + fromServer);
- if (fromServer.equals("Bye"))
- break;
- System.out.print("Enter your choice: ");
- fromClient = stdIn.readLine().trim();
- if(fromClient.equals("1"))
- {
- System.out.println("Client: " + fromClient);
- output.println(fromClient);
- }
- System.out.print("Enter your choice: ");
- fromClient = stdIn.readLine().trim();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement