Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Correction of some bugs and performance enhancement.
[jaceP2P.git] / src / jaceP2P / SendVerifThread.java
1 package jaceP2P;
2
3 public class SendVerifThread extends Thread {
4         int myId;
5         int verifNum;
6         int sendId;
7
8         public SendVerifThread(int myId, int sendId, int verifNum) {
9                 this.myId = myId;
10                 this.verifNum = verifNum;
11                 this.sendId = sendId;
12
13         }
14
15         public void run() {
16                 while (JaceSession.Instance().getTaskObject().action
17                                 .equals("sendVerif")) {
18                         try {
19                                 JaceSession.Instance().getTaskObject().broadcastVerif(myId,
20                                                 sendId, verifNum);
21                                 JaceSession.Instance().getTaskObject().broadcastTasks(3);
22                         } catch (Exception e) {
23                                 System.err.println("The verification message is not received: " + e);
24                                 try {
25                                         Thread.sleep(500);
26                                 } catch (Exception ex) {
27                                 }
28                         }
29
30                 }
31         }
32 }