def onMessage(self, responseMsg): GatewaySession.onMessage(self, responseMsg) if responseMsg.ID == isefix.LogonResp.ID: self._setThrottlingRate(responseMsg) self.loggedIn = True if responseMsg.ID == isefix.Reject.ID and responseMsg.ResponseHeader.MsgSeqNum == 1: self.logonRejected = True self.logonRejectedReason = responseMsg.Text
def login(self): GatewaySession.login(self) st_time = time.time() timedOut = False while not self.loggedIn and not self.logonRejected and not timedOut: time.sleep(0.1) timedOut = (time.time() - st_time) > self.LOGIN_TIMEOUT_SECS if timedOut: self.logonRejected = True self.logonRejectedReason = "No response received in %s" % self.LOGIN_TIMEOUT_SECS
def __init__(self, config, msgFile=None): GatewaySession.__init__(self, config, msgFile=msgFile) self.loggedIn = False self.logonRejected = False self.logonRejectedReason = "" self.rate = None