Author: titmuss
Date: Wed Jan 16 09:53:59 2008
New Revision: 1467

URL: http://svn.slimdevices.com?rev=1467&root=Jive&view=rev
Log:
Bug: N/A
Description:
Don't disconnect from the server before sending the disconnect message, this 
only 
makes us connect again. Disconnect only after getting the response from the 
server.


Modified:
    trunk/jive/src/pkg/jive/share/jive/net/Comet.lua

Modified: trunk/jive/src/pkg/jive/share/jive/net/Comet.lua
URL: 
http://svn.slimdevices.com/trunk/jive/src/pkg/jive/share/jive/net/Comet.lua?rev=1467&root=Jive&r1=1466&r2=1467&view=diff
==============================================================================
--- trunk/jive/src/pkg/jive/share/jive/net/Comet.lua (original)
+++ trunk/jive/src/pkg/jive/share/jive/net/Comet.lua Wed Jan 16 09:53:59 2008
@@ -113,7 +113,7 @@
        
        obj.jnt            = jnt
        obj.name           = name
-       obj.active         = "closed" -- whether or not we have an active 
connection: [ closed, handshake, connected ]
+       obj.active         = "closed" -- whether or not we have an active 
connection: [ closed, handshake, connected, disconnect ]
        obj.clientId       = nil      -- clientId provided by server
        obj.reqid          = 1        -- used to identify non-subscription 
requests
        obj.advice         = {}       -- advice from server on how to handle 
reconnects
@@ -154,7 +154,7 @@
        
                log:debug('Comet:disconnect()')
                
-               _active(self, "closed")
+               _active(self, "disconnect")
 
                -- Mark all subs as pending so they can be resubscribed later
                for i, v in ipairs( self.subs ) do
@@ -338,6 +338,7 @@
                                elseif event.channel == '/meta/disconnect' then
                                        if event.successful then
                                                log:debug("Comet:_getEventSink, 
disconnect OK")
+                                               _active(self, "closed")
                                        else
                                                log:warn("Comet:_getEventSink, 
disconnect failed: ", event.error)
                                        end
@@ -791,8 +792,6 @@
 -- Notify changes in connection state
 _active = function(self, active)
 
-                 log:warn("ACTIVE was=", self.active, " now=", active)
-
         if self.active == active then
                return
        end
@@ -804,7 +803,7 @@
                self.failures = 0
 
                self.jnt:notify('cometConnected', self)
-       else
+       elseif active == "closed" then
                -- force connections closed
                self.chttp:close()
                self.rhttp:close()

_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins

Reply via email to