本文整理匯總了C#中QuickFix.SessionSettings.GetSessions方法的典型用法代碼示例。如果您正苦於以下問題:C# SessionSettings.GetSessions方法的具體用法?C# SessionSettings.GetSessions怎麽用?C# SessionSettings.GetSessions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類QuickFix.SessionSettings
的用法示例。
在下文中一共展示了SessionSettings.GetSessions方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: AbstractInitiator
public AbstractInitiator(
IApplication app, IMessageStoreFactory storeFactory, SessionSettings settings, ILogFactory logFactory, IMessageFactory messageFactory)
{
_app = app;
_storeFactory = storeFactory;
_settings = settings;
_logFactory = logFactory;
_msgFactory = messageFactory;
HashSet<SessionID> definedSessions = _settings.GetSessions();
if (0 == definedSessions.Count)
throw new ConfigError("No sessions defined");
}
示例2: AbstractInitiator
public AbstractInitiator(SessionFactory factory, SessionSettings settings)
{
settings_ = settings;
HashSet<SessionID> definedSessions = settings.GetSessions();
if (0 == definedSessions.Count)
throw new ConfigError("No sessions defined");
foreach (SessionID sessionID in definedSessions)
{
Dictionary dict = settings.Get(sessionID);
if ("initiator".Equals(dict.GetString(SessionSettings.CONNECTION_TYPE)))
{
sessionIDs_.Add(sessionID);
sessions_[sessionID] = factory.Create(sessionID, dict);
SetDisconnected(sessionID);
}
}
if (0 == sessions_.Count)
throw new ConfigError("No sessions defined for initiator");
}
示例3: CreateSessions
private void CreateSessions(SessionSettings settings, SessionFactory sessionFactory)
{
sessionFactory_ = sessionFactory;
settings_ = settings;
foreach (SessionID sessionID in settings.GetSessions())
{
QuickFix.Dictionary dict = settings.Get(sessionID);
CreateSession(sessionID, dict);
}
if (0 == socketDescriptorForAddress_.Count)
throw new ConfigError("No acceptor sessions found in SessionSettings.");
}
示例4: CreateSessions
private void CreateSessions(SessionSettings settings, SessionFactory sessionFactory)
{
foreach (SessionID sessionID in settings.GetSessions())
{
QuickFix.Dictionary dict = settings.Get(sessionID);
string connectionType = dict.GetString(SessionSettings.CONNECTION_TYPE);
if ("acceptor".Equals(connectionType))
{
AcceptorSocketDescriptor descriptor = GetAcceptorSocketDescriptor(settings, sessionID);
Session session = sessionFactory.Create(sessionID, dict);
descriptor.AcceptSession(session);
sessions_[sessionID] = session;
}
}
if (0 == socketDescriptorForAddress_.Count)
throw new ConfigError("No acceptor sessions found in SessionSettings.");
}
示例5: testExtendedSettings
public void testExtendedSettings()
{
string settingsString = new System.Text.StringBuilder()
.AppendLine("[DEFAULT]")
.AppendLine("ConnectionType=initiator")
.AppendLine("HeartBtInt=60")
.AppendLine("[SESSION]")
.AppendLine("BeginString=FIX.4.2")
.AppendLine("SenderCompID=Company")
.AppendLine("SenderSubID=FixedIncome")
.AppendLine("SenderLocationID=HongKong")
.AppendLine("TargetCompID=CLIENT1")
.AppendLine("TargetSubID=HedgeFund")
.AppendLine("TargetLocationID=NYC")
.AppendLine("SendRedundantResendRequests=Y")
.AppendLine("MillisecondsInTimeStamp=Y")
.AppendLine("EnableLastMsgSeqNumProcessed=Y")
.AppendLine("MaxMessagesInResendRequest=2500")
.AppendLine("StartTime=06:00:00")
.AppendLine("EndTime=05:59:00")
.ToString();
SessionSettings settings = new SessionSettings(new System.IO.StringReader(settingsString));
SessionID id = new SessionID("FIX.4.2", "Company", "FixedIncome", "HongKong", "CLIENT1", "HedgeFund", "NYC");
Assert.That(settings.Get(id).GetString("HeartBtInt"), Is.EqualTo("60"));
Assert.That(settings.Get(id).GetString("BeginString"), Is.EqualTo("FIX.4.2"));
Assert.That(settings.Get(id).GetString("SenderCompID"), Is.EqualTo("Company"));
Assert.That(settings.Get(id).GetString("SenderSubID"), Is.EqualTo("FixedIncome"));
Assert.That(settings.Get(id).GetString("SenderLocationID"), Is.EqualTo("HongKong"));
Assert.That(settings.Get(id).GetString("TargetCompID"), Is.EqualTo("CLIENT1"));
Assert.That(settings.Get(id).GetString("TargetSubID"), Is.EqualTo("HedgeFund"));
Assert.That(settings.Get(id).GetString("TargetLocationID"), Is.EqualTo("NYC"));
Assert.That(settings.Get(id).GetString("SendRedundantResendRequests"), Is.EqualTo("Y"));
Assert.That(settings.Get(id).GetString("MillisecondsInTimeStamp"), Is.EqualTo("Y"));
Assert.That(settings.Get(id).GetString("EnableLastMsgSeqNumProcessed"), Is.EqualTo("Y"));
Assert.That(settings.Get(id).GetString("MaxMessagesInResendRequest"), Is.EqualTo("2500"));
Assert.That(settings.Get(id).GetString("StartTime"), Is.EqualTo("06:00:00"));
Assert.That(settings.Get(id).GetString("EndTime"), Is.EqualTo("05:59:00"));
id = null;
foreach(SessionID sid in settings.GetSessions())
{
id = sid;
break;
}
Assert.NotNull(id);
Assert.That(id.BeginString, Is.EqualTo("FIX.4.2"));
Assert.That(id.SenderCompID, Is.EqualTo("Company"));
Assert.That(id.SenderSubID, Is.EqualTo("FixedIncome"));
Assert.That(id.SenderLocationID, Is.EqualTo("HongKong"));
Assert.That(id.TargetCompID, Is.EqualTo("CLIENT1"));
Assert.That(id.TargetSubID, Is.EqualTo("HedgeFund"));
Assert.That(id.TargetLocationID, Is.EqualTo("NYC"));
}