File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
interoperability/mqtt/brokers/V311 Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,11 @@ def cleanSession(self, aClientid):
5353
5454 def connect (self , aClient ):
5555 aClient .connected = True
56- aClient .timestamp = time .clock ()
56+ try :
57+ aClient .timestamp = time .clock ()
58+ except AttributeError :
59+ aClient .timestamp = time .time ()
60+
5761 self .__clients [aClient .id ] = aClient
5862 if aClient .cleansession :
5963 self .cleanSession (aClient .id )
@@ -80,8 +84,11 @@ def disconnect(self, aClientid):
8084 del self .__clients [aClientid ]
8185 else :
8286 logger .info ("[MQTT-3.1.2-4] broker must store the session data for client %s" , aClientid )
83- self .__clients [aClientid ].timestamp = time .clock ()
84- self .__clients [aClientid ].connected = False
87+ try :
88+ self .__clients [aClientid ].timestamp = time .clock ()
89+ except AttributeError :
90+ self .__clients [aClientid ].timestamp = time .time ()
91+ self .__clients [aClientid ].connected = False
8592 logger .info ("[MQTT-3.1.2-10] will message is deleted after use or disconnect, for client %s" , aClientid )
8693 logger .info ("[MQTT-3.14.4-3] on receipt of disconnect, will message is deleted" )
8794 self .__clients [aClientid ].will = None
You can’t perform that action at this time.
0 commit comments