本文整理汇总了C#中QuickFix.GetLong方法的典型用法代码示例。如果您正苦于以下问题:C# QuickFix.GetLong方法的具体用法?C# QuickFix.GetLong怎么用?C# QuickFix.GetLong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QuickFix
的用法示例。
在下文中一共展示了QuickFix.GetLong方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetNextSocketEndPoint
private IPEndPoint GetNextSocketEndPoint(SessionID sessionID, QuickFix.Dictionary settings)
{
int num;
if (!sessionToHostNum_.TryGetValue(sessionID, out num))
num = 0;
string hostKey = SessionSettings.SOCKET_CONNECT_HOST + num;
string portKey = SessionSettings.SOCKET_CONNECT_PORT + num;
if (!settings.Has(hostKey) || !settings.Has(portKey))
{
num = 0;
hostKey = SessionSettings.SOCKET_CONNECT_HOST;
portKey = SessionSettings.SOCKET_CONNECT_PORT;
}
try
{
IPAddress[] addrs = Dns.GetHostAddresses(settings.GetString(hostKey));
int port = System.Convert.ToInt32(settings.GetLong(portKey));
sessionToHostNum_[sessionID] = ++num;
return new IPEndPoint(addrs[0], port);
}
catch (System.Exception e)
{
throw new ConfigError(e.Message, e);
}
}
示例2: Create
public Session Create(SessionID sessionID, QuickFix.Dictionary settings)
{
string connectionType = settings.GetString(SessionSettings.CONNECTION_TYPE);
if (!"acceptor".Equals(connectionType) && !"initiator".Equals(connectionType))
throw new ConfigError("Invalid ConnectionType");
if ("acceptor".Equals(connectionType) && settings.Has(SessionSettings.SESSION_QUALIFIER))
throw new ConfigError("SessionQualifier cannot be used with acceptor.");
bool useDataDictionary = true;
if (settings.Has(SessionSettings.USE_DATA_DICTIONARY))
useDataDictionary = settings.GetBool(SessionSettings.USE_DATA_DICTIONARY);
QuickFix.Fields.ApplVerID defaultApplVerID = null;
if (sessionID.IsFIXT)
{
if (!settings.Has(SessionSettings.DEFAULT_APPLVERID))
{
throw new ConfigError("ApplVerID is required for FIXT transport");
}
defaultApplVerID = Message.GetApplVerID(settings.GetString(SessionSettings.DEFAULT_APPLVERID));
}
DataDictionaryProvider dd = new DataDictionaryProvider();
if (useDataDictionary)
{
if (sessionID.IsFIXT)
ProcessFixTDataDictionaries(sessionID, settings, dd);
else
ProcessFixDataDictionary(sessionID, settings, dd);
}
int heartBtInt = 0;
if ( connectionType == "initiator" )
{
heartBtInt = System.Convert.ToInt32(settings.GetLong( SessionSettings.HEARTBTINT ));
if ( heartBtInt <= 0 )
throw new ConfigError( "Heartbeat must be greater than zero" );
}
string senderDefaultApplVerId = "";
if(defaultApplVerID != null)
senderDefaultApplVerId = defaultApplVerID.Obj;
Session session = new Session(
application_,
messageStoreFactory_,
sessionID,
dd,
new SessionSchedule(settings),
heartBtInt,
logFactory_,
messageFactory_,
senderDefaultApplVerId);
if (settings.Has(SessionSettings.SEND_REDUNDANT_RESENDREQUESTS))
session.SendRedundantResendRequests = settings.GetBool(SessionSettings.SEND_REDUNDANT_RESENDREQUESTS);
if (settings.Has(SessionSettings.RESEND_SESSION_LEVEL_REJECTS))
session.ResendSessionLevelRejects = settings.GetBool(SessionSettings.RESEND_SESSION_LEVEL_REJECTS);
/** FIXME - implement optional settings
if (settings.Has(SessionSettings.CHECK_COMPID))
session.SetCheckCompId(settings.GetBool(SessionSettings.CHECK_COMPID));
*/
if (settings.Has(SessionSettings.CHECK_LATENCY))
session.CheckLatency = settings.GetBool(SessionSettings.CHECK_LATENCY);
if (settings.Has(SessionSettings.MAX_LATENCY))
session.MaxLatency = settings.GetInt(SessionSettings.MAX_LATENCY);
if (settings.Has(SessionSettings.LOGON_TIMEOUT))
session.LogonTimeout = settings.GetInt(SessionSettings.LOGON_TIMEOUT);
if (settings.Has(SessionSettings.LOGOUT_TIMEOUT))
session.LogoutTimeout = settings.GetInt(SessionSettings.LOGOUT_TIMEOUT);
if (settings.Has(SessionSettings.RESET_ON_LOGON))
session.ResetOnLogon = settings.GetBool(SessionSettings.RESET_ON_LOGON);
if (settings.Has(SessionSettings.RESET_ON_LOGOUT))
session.ResetOnLogout = settings.GetBool(SessionSettings.RESET_ON_LOGOUT);
if (settings.Has(SessionSettings.RESET_ON_DISCONNECT))
session.ResetOnDisconnect = settings.GetBool(SessionSettings.RESET_ON_DISCONNECT);
if (settings.Has(SessionSettings.REFRESH_ON_LOGON))
session.RefreshOnLogon = settings.GetBool(SessionSettings.REFRESH_ON_LOGON);
if (settings.Has(SessionSettings.PERSIST_MESSAGES))
session.PersistMessages = settings.GetBool(SessionSettings.PERSIST_MESSAGES);
if (settings.Has(SessionSettings.MILLISECONDS_IN_TIMESTAMP))
session.MillisecondsInTimeStamp = settings.GetBool(SessionSettings.MILLISECONDS_IN_TIMESTAMP);
if (settings.Has(SessionSettings.ENABLE_LAST_MSG_SEQ_NUM_PROCESSED))
session.EnableLastMsgSeqNumProcessed = settings.GetBool(SessionSettings.ENABLE_LAST_MSG_SEQ_NUM_PROCESSED);
if (settings.Has(SessionSettings.MAX_MESSAGES_IN_RESEND_REQUEST))
session.MaxMessagesInResendRequest = settings.GetInt(SessionSettings.MAX_MESSAGES_IN_RESEND_REQUEST);
if (settings.Has(SessionSettings.SEND_LOGOUT_BEFORE_TIMEOUT_DISCONNECT))
session.SendLogoutBeforeTimeoutDisconnect = settings.GetBool(SessionSettings.SEND_LOGOUT_BEFORE_TIMEOUT_DISCONNECT);
if (settings.Has(SessionSettings.IGNORE_POSSDUP_RESEND_REQUESTS))
session.IgnorePossDupResendRequests = settings.GetBool(SessionSettings.IGNORE_POSSDUP_RESEND_REQUESTS);
if (settings.Has(SessionSettings.VALIDATE_LENGTH_AND_CHECKSUM))
session.ValidateLengthAndChecksum = settings.GetBool(SessionSettings.VALIDATE_LENGTH_AND_CHECKSUM);
if (settings.Has(SessionSettings.RESETSEQUENCE_MESSAGE_REQUIRES_ORIGSENDINGTIME))
session.RequiresOrigSendingTime = settings.GetBool(SessionSettings.RESETSEQUENCE_MESSAGE_REQUIRES_ORIGSENDINGTIME);
return session;
}
示例3: Create
public Session Create(SessionID sessionID, QuickFix.Dictionary settings)
{
string connectionType = settings.GetString(SessionSettings.CONNECTION_TYPE);
if (!"acceptor".Equals(connectionType) && !"initiator".Equals(connectionType))
throw new ConfigError("Invalid ConnectionType");
if ("acceptor".Equals(connectionType) && settings.Has(SessionSettings.SESSION_QUALIFIER))
throw new ConfigError("SessionQualifier cannot be used with acceptor.");
bool useDataDictionary = true;
if (settings.Has(SessionSettings.USE_DATA_DICTIONARY))
useDataDictionary = settings.GetBool(SessionSettings.USE_DATA_DICTIONARY);
string defaultApplVerID = "";
if (sessionID.IsFIXT)
{
throw new System.NotImplementedException("FIXME - SessionFactory cannot handle FIXT Sessions!");
/*
if (!settings.Has(SessionSettings.DEFAULT_APPLVERID))
{
throw new ConfigError("ApplVerID is required for FIXT transport");
}
defaultApplVerID = Message.ToApplVerID(settings.GetString(SessionSettings.DEFAULT_APPLVERID));
*/
}
DataDictionaryProvider dd = new DataDictionaryProvider();
if (useDataDictionary)
{
if (sessionID.IsFIXT)
throw new System.NotImplementedException("FIXME - SessionFactory cannot handle 'UseDataDictionary=Y' for 'FIXT' sessions!");
else
ProcessFixDataDictionary(sessionID, settings, dd);
}
int heartBtInt = 0;
if ( connectionType == "initiator" )
{
heartBtInt = System.Convert.ToInt32(settings.GetLong( SessionSettings.HEARTBTINT ));
if ( heartBtInt <= 0 )
throw new ConfigError( "Heartbeat must be greater than zero" );
}
Session session = new Session(
application_,
messageStoreFactory_,
sessionID,
dd,
new SessionSchedule(settings, sessionID),
heartBtInt,
logFactory_,
new DefaultMessageFactory());
session.SenderDefaultApplVerID = defaultApplVerID;
/** FIXME - implement optional settings
if (settings.Has(SessionSettings.SEND_REDUNDANT_RESENDREQUESTS))
session.SetSendRedundantResendRequests(settings.GetBool(SessionSettings.SEND_REDUNDANT_RESENDREQUESTS));
if (settings.Has(SessionSettings.CHECK_COMPID))
session.SetCheckCompId(settings.GetBool(SessionSettings.CHECK_COMPID));
if (settings.Has(SessionSettings.CHECK_LATENCY))
session.SetCheckLatency(settings.GetBool(SessionSettings.CHECK_LATENCY));
if (settings.Has(SessionSettings.MAX_LATENCY))
session.SetMaxLatency(settings.GetLong(SessionSettings.MAX_LATENCY));
if (settings.Has(SessionSettings.LOGON_TIMEOUT))
session.SetLogonTimeout(settings.GetLong(SessionSettings.LOGON_TIMEOUT));
if (settings.Has(SessionSettings.LOGOUT_TIMEOUT))
session.SetLogoutTimeout(settings.GetLong(SessionSettings.LOGOUT_TIMEOUT));
*/
// FIXME to get from config if available
session.MaxLatency = 120;
session.CheckLatency = true;
if (settings.Has(SessionSettings.RESET_ON_LOGON))
session.ResetOnLogon = settings.GetBool(SessionSettings.RESET_ON_LOGON);
if (settings.Has(SessionSettings.RESET_ON_LOGOUT))
session.ResetOnLogout = settings.GetBool(SessionSettings.RESET_ON_LOGOUT);
if (settings.Has(SessionSettings.RESET_ON_DISCONNECT))
session.ResetOnDisconnect = settings.GetBool(SessionSettings.RESET_ON_DISCONNECT);
if (settings.Has(SessionSettings.REFRESH_ON_LOGON))
session.RefreshOnLogon = settings.GetBool(SessionSettings.REFRESH_ON_LOGON);
/** FIXME - implement optional settings
if (settings.Has(SessionSettings.MILLISECONDS_IN_TIMESTAMP))
session.SetMillisecondsInTimeStamp(settings.GetBool(SessionSettings.MILLISECONDS_IN_TIMESTAMP));
if (settings.Has(SessionSettings.PERSIST_MESSAGES))
session.SetPersistMessages(settings.GetBool(SessionSettings.PERSIST_MESSAGES));
if (settings.Has(SessionSettings.VALIDATE_LENGTH_AND_CHECKSUM))
session.SetValidateLengthAndChecksum(settings.GetBool(SessionSettings.VALIDATE_LENGTH_AND_CHECKSUM));
*/
return session;
}