def _connect_qry_channel(self): OesApi_SetThreadUsername(self.username) OesApi_SetThreadPassword(self.password) return OesApi_InitQryChannel2(self._env.qryChannel, create_remote_config(self.qry_server, self.username, self.password))
def _connect_ord_channel(self): OesApi_SetThreadUsername(self.username) OesApi_SetThreadPassword(self.password) if not OesApi_InitOrdChannel2(self._env.ordChannel, create_remote_config(self.ord_server, self.username, self.password), 0): return False self._last_seq_index = max(self._last_seq_index, self._env.ordChannel.lastOutMsgSeq + 1) return True
def connect_rpt_channel(self): OesApi_SetThreadUsername(self.username) OesApi_SetThreadPassword(self.password) subscribe_info = OesApiSubscribeInfoT() subscribe_info.clEnvId = 0 subscribe_info.rptTypes = ( eOesSubscribeReportTypeT.OES_SUB_RPT_TYPE_BUSINESS_REJECT | eOesSubscribeReportTypeT.OES_SUB_RPT_TYPE_ORDER_INSERT | eOesSubscribeReportTypeT.OES_SUB_RPT_TYPE_ORDER_REPORT | eOesSubscribeReportTypeT.OES_SUB_RPT_TYPE_TRADE_REPORT | eOesSubscribeReportTypeT.OES_SUB_RPT_TYPE_FUND_TRSF_REPORT | eOesSubscribeReportTypeT.OES_SUB_RPT_TYPE_CASH_ASSET_VARIATION | eOesSubscribeReportTypeT.OES_SUB_RPT_TYPE_HOLDING_VARIATION) return OesApi_InitRptChannel2( self._env.rptChannel, create_remote_config(self.rpt_server, self.username, self.password), subscribe_info, 0)