Example #1
0
 def lost_connection(self, server, channel):
     ckey = channel.peername #自改abu为channel加上此属性,因socket已不可用,不能getpeername
     msg = 'lost a connection:%s' % str(ckey)
     comm.trace(msg)
     if ckey in self.Clients:
         try: #清空些用户的资料 
             uid = self.Clients[ckey]['uid']
             if uid:
                 Gcore.getMod('Login', uid).logout() #更新
                 Gcore.onlineUser.pop(uid,None) #用户落线
                 Gcore.delUserStorage(uid)
         except Exception,e:
             print 'lost_connection >> ',e
         self.Clients.pop(ckey) 
Example #2
0
 def new_connection(self, server, channel):
     msg = '%s has a new connection:%s' % (server, channel.peername)
     comm.trace(msg)