private InstrumentData getInstrumentData() { CALCULATION_QUEUE_INFO_Table_DAOManager daoM = new CALCULATION_QUEUE_INFO_Table_DAOManager(); daoM.select(DataBaseConnectManager.ConnectionFactory(DataBaseConnectManager.ConnectionString_)); InstrumentData instrumentData = new InstrumentData(); instrumentData.InstrumentCode_ = daoM.DAOList_[0].INST_CODE_; instrumentData.InstrumentType_ = daoM.DAOList_[0].INST_TYPE_; //instrumentData.InstrumentXml_= daoM.DAOList_[0].INST_MSGXML; return(instrumentData); }
public override void DoJob() { //List<InstrumentDataEnQueueJob> jobList = new List<InstrumentDataEnQueueJob>(); //List<AsynchronousClient> asynchronousClientList = new List<AsynchronousClient>(); //foreach (var item in jobList) //{ // AsynchronousClient client = new AsynchronousClient(); // asynchronousClientList.Add(client); //} // check number calc server List <Task> taskList = new List <Task>(); while (this.calculationComplete()) { // 쌓인 것중에 하나 가져옴 다 가져왔음? InstrumentData instrumentData = this.getInstrumentData(); // 살아있는 서버 찾음. TargetServerInfoViewModel tsivm = this.AliveServer(); // 연결함. AsynchronousClient client = new AsynchronousClient(tsivm); // Task task = new Task(() => { client.StartClient(instrumentData); }); task.Start(); taskList.Add(task); if (!this.calculationAvailable()) { int completeIndex = Task.WaitAny(taskList.ToArray()); } } //for (int i = 0; i < taskArray.Length; i++) //{ // Console.WriteLine(asynchronousClientList[i].RecieveData_); // //results[i] = taskArray[i].Result; //} }
private InstrumentData getInstrumentData() { CALCULATION_QUEUE_INFO_Table_DAOManager daoM = new CALCULATION_QUEUE_INFO_Table_DAOManager(); daoM.select(DataBaseConnectManager.ConnectionFactory(DataBaseConnectManager.ConnectionString_)); InstrumentData instrumentData = new InstrumentData(); instrumentData.InstrumentCode_ = daoM.DAOList_[0].INST_CODE_; instrumentData.InstrumentType_ = daoM.DAOList_[0].INST_TYPE_; //instrumentData.InstrumentXml_= daoM.DAOList_[0].INST_MSGXML; return instrumentData; }