本文整理匯總了C#中QuickFix.Message.GetSessionID方法的典型用法代碼示例。如果您正苦於以下問題:C# Message.GetSessionID方法的具體用法?C# Message.GetSessionID怎麽用?C# Message.GetSessionID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類QuickFix.Message
的用法示例。
在下文中一共展示了Message.GetSessionID方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: SendToTarget
/// <summary>
/// Send to session indicated by header fields in message
/// </summary>
/// <param name="message"></param>
/// <returns></returns>
public static bool SendToTarget(Message message)
{
SessionID sessionID = message.GetSessionID(message);
return SendToTarget(message, sessionID);
}
示例2: TestGetSetSessionID
public void TestGetSetSessionID()
{
SessionID sessionID = new SessionID("FIX.4.2", "SENDER", "SENDERSUB", "SENDERLOC", "TARGET", "TARGETSUB", "TARGETLOC");
Message msg = new Message();
msg.SetSessionID(sessionID);
Assert.That(msg.Header.GetString(Tags.BeginString), Is.EqualTo("FIX.4.2"));
Assert.That(msg.Header.GetString(Tags.SenderCompID), Is.EqualTo("SENDER"));
Assert.That(msg.Header.GetString(Tags.SenderSubID), Is.EqualTo("SENDERSUB"));
Assert.That(msg.Header.GetString(Tags.SenderLocationID), Is.EqualTo("SENDERLOC"));
Assert.That(msg.Header.GetString(Tags.TargetCompID), Is.EqualTo("TARGET"));
Assert.That(msg.Header.GetString(Tags.TargetSubID), Is.EqualTo("TARGETSUB"));
Assert.That(msg.Header.GetString(Tags.TargetLocationID), Is.EqualTo("TARGETLOC"));
SessionID getSessionID = msg.GetSessionID(msg);
Assert.That(getSessionID.BeginString, Is.EqualTo("FIX.4.2"));
Assert.That(getSessionID.SenderCompID, Is.EqualTo("SENDER"));
Assert.That(getSessionID.SenderSubID, Is.EqualTo("SENDERSUB"));
Assert.That(getSessionID.SenderLocationID, Is.EqualTo("SENDERLOC"));
Assert.That(getSessionID.TargetCompID, Is.EqualTo("TARGET"));
Assert.That(getSessionID.TargetSubID, Is.EqualTo("TARGETSUB"));
Assert.That(getSessionID.TargetLocationID, Is.EqualTo("TARGETLOC"));
////
sessionID = new SessionID("FIX.4.2", "SENDER", "TARGET");
msg = new Message();
msg.SetSessionID(sessionID);
Assert.That(msg.Header.GetString(Tags.BeginString), Is.EqualTo("FIX.4.2"));
Assert.That(msg.Header.GetString(Tags.SenderCompID), Is.EqualTo("SENDER"));
Assert.That(msg.Header.IsSetField(Tags.SenderSubID), Is.False);
Assert.That(msg.Header.IsSetField(Tags.SenderLocationID), Is.False);
Assert.That(msg.Header.GetString(Tags.TargetCompID), Is.EqualTo("TARGET"));
Assert.That(msg.Header.IsSetField(Tags.TargetSubID), Is.False);
Assert.That(msg.Header.IsSetField(Tags.TargetLocationID), Is.False);
getSessionID = msg.GetSessionID(msg);
Assert.That(getSessionID.BeginString, Is.EqualTo("FIX.4.2"));
Assert.That(getSessionID.SenderCompID, Is.EqualTo("SENDER"));
Assert.That(getSessionID.SenderSubID, Is.EqualTo(""));
Assert.That(getSessionID.SenderLocationID, Is.EqualTo(""));
Assert.That(getSessionID.TargetCompID, Is.EqualTo("TARGET"));
Assert.That(getSessionID.TargetSubID, Is.EqualTo(""));
Assert.That(getSessionID.TargetLocationID, Is.EqualTo(""));
}