def ping(self, ctx): ITerminalGatewayServer.ping(self, ctx) print desert.misc.currentDateTimeStr(), 'ping() from: ',ctx.conn.getAddress() userid = ctx.conn.getUserId() serverid = tce.RpcCommunicator.instance().currentServer().getName() #server_eps.conf 对应 server_id 与 mq 名称 self.redis.set( koala.base.CacheEntryFormat.UserWithTGS%userid,serverid,HEARTBEAT_TIMEOUT)