public
Description: Tomporary (hopefully) fork of XMPP4R-Simple
Homepage: http://code.google.com/p/xmpp4r-simple/
Clone URL: git://github.com/dysinger/xmpp4r-simple.git
Search Repo:
don't allow multiple reconnecting threads to stomp all over eachother.

git-svn-id: http://xmpp4r-simple.googlecode.com/svn/trunk@34 
1e3c5029-9921-0410-9e82-436f4d538387
romeda (author)
Fri Mar 02 11:47:01 -0800 2007
commit  b5fac2553b202b2843060ad4e0f6675ddddf36d3
tree    15fb774d82bfbb45ae9051d6926753291ed38ea5
parent  cbc8c73fc4d37c62972a2c0e2f651cae7b89d37a
...
381
382
383
 
 
 
 
384
385
386
...
381
382
383
384
385
386
387
388
389
390
0
@@ -381,6 +381,10 @@
0
       raise ConnectionError, "Connections are disabled - use Jabber::Simple::force_connect() to reconnect." if @disconnected
0
       # Pre-connect
0
       @connect_mutex ||= Mutex.new
0
+
0
+ # don't try to connect if another thread is already connecting.
0
+ return if @connect_mutex.locked?
0
+
0
       @connect_mutex.lock
0
       disconnect!(false) if connected?
0
 

Comments

    No one has commented yet.