private void btnHeartbeat_Click(object sender, EventArgs e) { ClearText(); var message = _messageConstructor.HeartbeatMessage(MessageConstructor.SessionQualifier.QUOTE, _messageSequenceNumber); txtMessageSend.Text = message; txtMessageReceived.Text = SendPriceMessage(message, false); }
//************************************************************* public ObservableCollection <string> Heartbeat() { try { ObservableCollection <string> xReVal = new ObservableCollection <string>(); string xOut = _MessageConstructor.HeartbeatMessage(MessageConstructor.SessionQualifier.QUOTE, _MessageSequenceNumber); string xIn = SendMessage(xOut, _NetStream, true).Replace(Tool.SOH, '|');; xReVal.Add(xOut.Replace(Tool.SOH, '|')); xReVal.Add(xIn.Replace(Tool.SOH, '|')); //if (xIn.GetMessageType() == "0") //{ // //Heartbeat successfully ==> return true. // xReVal = true; //} //else if (xIn.GetMessageType() == "2") //{ // //Heartbeat successfully ==> return true. // xReVal = true; //} //else //{ // //Heartbeat failed ==> return false. // xReVal = false; //} return(xReVal); } catch (IOException ex) { throw ex; } }