Browse Source

proceeding while awaiting thread response with simulated lag

Patrick Glavin 6 years ago
parent
commit
0851989063

+ 2
- 1
Client/src/main/java/MessageSender.java View File

17
         for (int i = 2; i < list.size(); i++) {
17
         for (int i = 2; i < list.size(); i++) {
18
             sentence += list.get(i) + " ";
18
             sentence += list.get(i) + " ";
19
         }
19
         }
20
+
20
         sentence = sentence.substring(0, sentence.length()-1);
21
         sentence = sentence.substring(0, sentence.length()-1);
21
         if (list.get(1).equalsIgnoreCase("group")){
22
         if (list.get(1).equalsIgnoreCase("group")){
22
             message = new Message(user.getGithub(), "", sentence);
23
             message = new Message(user.getGithub(), "", sentence);
23
         } else {
24
         } else {
24
             message = new Message(user.getGithub(), list.get(1), sentence);
25
             message = new Message(user.getGithub(), list.get(1), sentence);
25
         }
26
         }
26
-        
27
+
27
         String results = webber.send_message(message);
28
         String results = webber.send_message(message);
28
         try {
29
         try {
29
             Thread.sleep(10000);
30
             Thread.sleep(10000);

+ 1
- 1
Client/src/main/java/SimpleShell.java View File

128
                 if (list.contains("send")) {
128
                 if (list.contains("send")) {
129
                     MessageSender sender = new MessageSender(list, user, webber);
129
                     MessageSender sender = new MessageSender(list, user, webber);
130
                     Thread thread = new Thread(sender);
130
                     Thread thread = new Thread(sender);
131
-                    thread.run();
131
+                    thread.start();
132
                     continue;
132
                     continue;
133
                 }
133
                 }
134
 
134