/// <summary> /// Add username and password before sending the message /// </summary> /// <param name="message"></param> /// <param name="sessionId"></param> private void OnMessage(QuickFix.FIX44.Logon message, SessionID sessionId) { try { // Username & Password QuickFix.Fields.Username username = new QuickFix.Fields.Username(this._userName); QuickFix.Fields.Password password = new QuickFix.Fields.Password(this._password); QuickFix.Fields.SenderCompID senderCompId = new QuickFix.Fields.SenderCompID(_tradeSenderCompId); QuickFix.Fields.TargetCompID tragetCompId = new QuickFix.Fields.TargetCompID(_tradeTargetCompId); QuickFix.Fields.TargetSubID targerSubId = new QuickFix.Fields.TargetSubID(_tradeTargetSubId); QuickFix.Fields.ResetSeqNumFlag resetSeqNumFlag = new QuickFix.Fields.ResetSeqNumFlag(true); // Set values in the message body before sending to integral gateway message.Username = username; message.Password = password; message.SetField(senderCompId); message.SetField(tragetCompId); message.SetField(targerSubId); message.ResetSeqNumFlag = resetSeqNumFlag; } catch (Exception exception) { Logger.Error(exception.ToString(), _type.FullName, "OnMessage"); } }
/// <summary> /// Add username and password before sending the message /// </summary> /// <param name="message"></param> /// <param name="sessionId"></param> private void OnMessage(QuickFix.FIX44.Logon message, SessionID sessionId) { try { // Username & Password QuickFix.Fields.ResetSeqNumFlag resetSeqNumFlag = new QuickFix.Fields.ResetSeqNumFlag(true); QuickFix.Fields.EncryptMethod encryptMethod = new QuickFix.Fields.EncryptMethod(0); QuickFix.Fields.HeartBtInt heartBtInt = new QuickFix.Fields.HeartBtInt(GetHeartBeatInterval()); // Set values in the message body before sending message.ResetSeqNumFlag = resetSeqNumFlag; message.EncryptMethod = encryptMethod; message.HeartBtInt = heartBtInt; } catch (Exception exception) { Logger.Error(exception.ToString(), _type.FullName, "OnMessage"); } }