def onConnected(connectionManager, proto): from aclSystem.ttypes import Session session = Session() session.sessionID = 100 session.userID = 8 session.appID = confs.SourceId session.AppGroupId = 2 print('connect to tt success') from TTProto.ttypes import Registe registeMsg = Registe(session, confs.AppName, confs.Description) connectionManager.send(proto, 0, confs.SourceId, 0, registeMsg) reactor.callLater(30, sendHeartbeat, server, proto)
def onConnected(connectionManager, proto): #session = login(confs['LOGINHOST'], confs['LOGINPORT'], confs['USERNAME'], confs['PASSWORD'], confs['APPID'], confs['APPGROUPID']) from aclSystem.ttypes import Session session = Session() session.sessionID = 100 session.userID = 8 session.appID = sourceId session.AppGroupId = 2 from TTProto.ttypes import Registe registeMsg = Registe(session, 'pea', 'a mock client') connectionManager.send(proto, 0, sourceId, 0, registeMsg) reactor.callLater(30, sendHeartbeat, pea, proto)
def onConnected(connectionManager, proto): from aclSystem.ttypes import Session session = Session() session.sessionID = 100 session.userID = 8 session.appID = sourceId session.AppGroupId = 2 from TTProto.ttypes import Registe registeMsg = Registe(session, 'acl', 'a acl') connectionManager.send(proto, 0, sourceId, 0, registeMsg) # connectionManager.send(proto, 0, sourceId, 0, registeMsg,requestId) reactor.callLater(30, sendHeartbeat, pea, proto) reactor.callInThread(test, pea, proto)