`
linyu19872008
  • 浏览: 278498 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

asmack reconnection启动两次

 
阅读更多

 

 

 

原文出处:http://issues.igniterealtime.org/browse/SMACK-325

 

# This patch file was generated by NetBeans IDE

# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.

# It uses platform neutral UTF-8 encoding.

# Above lines and this line are ignored by the patching process.

3d2

< import java.util.Random;

24,25d22

< private Thread reconnectionThread;

< private int randomBase = new Random().nextInt(11) + 5; // between 5 and 15 seconds

68c65

<     synchronized protected void reconnect() {

---

>     protected void reconnect() {

70,72d66

<             // avoid to run duplicated reconnectionThread -- fd: 16/09/2010

<             if (reconnectionThread!=null && reconnectionThread.isAlive()) return;

<

75c69

< reconnectionThread = new Thread() {

---

>             Thread reconnectionThread = new Thread() {

87d80

< // fd: 16/09/10; modified to add a random wait

89d81

< attempts++;

91c83

<                         return randomBase*6*5;      // between 2.5 and 7.5 minutes (~5 minutes)

---

>                         return 60 * 5;      // 5 minutes

94c86

<                         return randomBase*6;       // between 30 and 90 seconds (~1 minute)

---

>                         return 60;          // 1 minute

96,98c88

<                     return randomBase;              // between 5 and 15 seconds (~10 seconds)

---

>                     return 10;              // 10 seconds

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics