|
1 |
| -package com.cardan.client; |
2 |
| - |
3 | 1 | import java.io.*;
|
4 | 2 | import java.net.*;
|
5 | 3 | import java.util.ArrayList;
|
@@ -35,18 +33,18 @@ public class cardanClient
|
35 | 33 | public static void main(String[] args) {
|
36 | 34 | InetAddress destIP;
|
37 | 35 | int destPort = 22333;
|
38 |
| - String strUrl = ""; |
39 |
| - int desiredBytes = 1460; |
40 |
| - int desiredTimeout = 0; |
41 |
| - int total_bytes_successfully_sent = 0; |
42 |
| - Scanner scanner = new Scanner(System.in); |
43 |
| - java.util.ArrayList<UDPThread> threadArray = new ArrayList<>(); |
44 |
| - |
45 |
| - System.out.println("Welcome to the cardanClient group project"); |
46 |
| - System.out.println("Please input desired web server \"w\", max number of bytes to send (less than 1460) " + |
| 36 | + String strUrl = ""; |
| 37 | + int desiredBytes = 1460; |
| 38 | + int desiredTimeout = 0; |
| 39 | + int total_bytes_successfully_sent = 0; |
| 40 | + Scanner scanner = new Scanner(System.in); |
| 41 | + java.util.ArrayList<UDPThread> threadArray = new ArrayList<>(); |
| 42 | + |
| 43 | + System.out.println("Welcome to the cardanClient group project"); |
| 44 | + System.out.println("Please input desired web server \"w\", max number of bytes to send (less than 1460) " + |
47 | 45 | "\"x\", and desired timeout in seconds \"y\". Use the format: w x y ");
|
48 |
| - System.out.println("Example: http://www.google.com 123 5"); |
49 |
| - System.out.print("> "); |
| 46 | + System.out.println("Example: http://www.google.com 123 5"); |
| 47 | + System.out.print("> "); |
50 | 48 |
|
51 | 49 | try{
|
52 | 50 | strUrl = scanner.next();
|
@@ -88,7 +86,6 @@ public static void main(String[] args) {
|
88 | 86 | reader = new BufferedReader(new InputStreamReader(con.getInputStream()));
|
89 | 87 | // Loop through the response and print it to the terminal
|
90 | 88 | while ((line = reader.readLine()) != null) {
|
91 |
| - // todo: Use threading to do the next lines at the same time |
92 | 89 | if(0 >= line.length()) {
|
93 | 90 | continue;
|
94 | 91 | }
|
|
0 commit comments