• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# SessionID类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中SessionID的典型用法代码示例。如果您正苦于以下问题:C# SessionID类的具体用法?C# SessionID怎么用?C# SessionID使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SessionID类属于命名空间,在下文中一共展示了SessionID类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: testSetGetSessionID

    public void testSetGetSessionID()
    {
        Dictionary dictionary1 = new Dictionary();
        dictionary1.setString( "ConnectionType", "initiator" );
        Dictionary dictionary2 = new Dictionary();
        dictionary2.setString( "ConnectionType", "acceptor" );

        SessionID sessionID1 = new SessionID( "FIX.4.0", "SENDER1", "TARGET1" );
        SessionID sessionID2 = new SessionID( "FIX.4.0", "SENDER2", "TARGET2" );
        SessionID sessionID3 = new SessionID( "FIX.4.0", "SENDER3", "TARGET3" );

        testObject.set( sessionID1, dictionary1 );
        testObject.set( sessionID2, dictionary2 );
        dictionary1 = testObject.get( sessionID1 );
        dictionary2 = testObject.get( sessionID2 );

        Assert.AreEqual( "initiator", dictionary1.getString("ConnectionType") );
        Assert.AreEqual( "acceptor", dictionary2.getString("ConnectionType") );

        try
        {
            testObject.get( sessionID3 );
            Assert.Fail();
        }
        catch( ConfigError ) {}
    }
开发者ID:jaubrey,项目名称:quickfix,代码行数:26,代码来源:SessionSettingsTest.cs


示例2: process

  public void process(Message message, SessionID sessionID)
  {
    Message echo = (Message)message;
    PossResend possResend = new PossResend(false);
    if (message.getHeader().isSetField(possResend))
      message.getHeader().getField(possResend);

    ClOrdID clOrdID = new ClOrdID();
    message.getField(clOrdID);

    Pair pair = new Pair(clOrdID, sessionID);

    if (possResend.getValue() == true)
    {
      if (orderIDs.Contains(pair))
        return;
    }
    if(!orderIDs.Contains(pair))
      orderIDs.Add(pair, pair);
    try
    {
      Session.sendToTarget(echo, sessionID);
    }
    catch (SessionNotFound) { }
  }
开发者ID:KorkyPlunger,项目名称:quickfix,代码行数:25,代码来源:at_messagecracker.cs


示例3: ScreenLog

 public ScreenLog(SessionID sessionID, bool logIncoming, bool logOutgoing, bool logEvent)
 {
     sessionID_   = sessionID;
     logIncoming_ = logIncoming;
     logOutgoing_ = logOutgoing;
     logEvent_    = logEvent;
 }
开发者ID:Jungers42,项目名称:quickfixn,代码行数:7,代码来源:ScreenLog.cs


示例4: Session

        public Session(
            IApplication app, IMessageStoreFactory storeFactory, SessionID sessID, DataDictionaryProvider dataDictProvider,
            SessionSchedule sessionSchedule, int heartBtInt, ILogFactory logFactory, IMessageFactory msgFactory, string senderDefaultApplVerID)
        {
            this.Application = app;
            this.SessionID = sessID;
            this.DataDictionaryProvider = new DataDictionaryProvider(dataDictProvider);
            this.schedule_ = sessionSchedule;
            this.msgFactory_ = msgFactory;

            this.SenderDefaultApplVerID = senderDefaultApplVerID;

            this.SessionDataDictionary = this.DataDictionaryProvider.GetSessionDataDictionary(this.SessionID.BeginString);
            if (this.SessionID.IsFIXT)
                this.ApplicationDataDictionary = this.DataDictionaryProvider.GetApplicationDataDictionary(this.SenderDefaultApplVerID);
            else
                this.ApplicationDataDictionary = this.SessionDataDictionary;

            ILog log;
            if (null != logFactory)
                log = logFactory.Create(sessID);
            else
                log = new NullLog();

            state_ = new SessionState(log, heartBtInt)
            {
                MessageStore = storeFactory.Create(sessID)
            };

            // Configuration defaults.
            // Will be overridden by the SessionFactory with values in the user's configuration.
            this.PersistMessages = true;
            this.ResetOnDisconnect = false;
            this.SendRedundantResendRequests = false;
            this.ValidateLengthAndChecksum = true;
            this.CheckCompID = true;
            this.MillisecondsInTimeStamp = true;
            this.EnableLastMsgSeqNumProcessed = false;
            this.MaxMessagesInResendRequest = 0;
            this.SendLogoutBeforeTimeoutDisconnect = false;
            this.IgnorePossDupResendRequests = false;
            this.RequiresOrigSendingTime = true;
            this.CheckLatency = true;
            this.MaxLatency = 120;

            if (!IsSessionTime)
                Reset("Out of SessionTime (Session construction)");
            else if (IsNewSession)
                Reset("New session");

            lock (sessions_)
            {
                sessions_[this.SessionID] = this;
            }

            this.Application.OnCreate(this.SessionID);
            this.Log.OnEvent("Created session");
        }
开发者ID:javagg,项目名称:kingstar_csharp_sdk,代码行数:58,代码来源:Session.cs


示例5: onMessage

 public override void onMessage(QuickFix43.SecurityDefinition message, SessionID sessionID)
 {
     QuickFix43.SecurityDefinition echo = message;
     try
     {
       Session.sendToTarget(echo, sessionID);
     }
     catch (SessionNotFound) { }
 }
开发者ID:hurdad,项目名称:quickfix,代码行数:9,代码来源:at_messagecracker.cs


示例6: onCreate

 public void onCreate( SessionID sessionID )
 {
     Session session = Session.lookupSession( sessionID );
     try
     {
       if ( session != null ) session.reset();
     }
     catch( Exception ) {}
 }
开发者ID:hurdad,项目名称:quickfix,代码行数:9,代码来源:at_application.cs


示例7: Create

        /// <summary>
        /// Creates a file-based message store
        /// </summary>
        /// <param name="sessionID">session ID for the message store</param>
        /// <returns></returns>
        public Log Create(SessionID sessionID)
        {
            Dictionary sessionSettings = settings_.Get(sessionID);
            bool RotateLog = false; //default if undefined
            int RotateLogNumToKeep = 1; //default if undefined

            if (sessionSettings.Has(SessionSettings.FILE_LOG_ROTATE_ON_NEW_SESSION))
                RotateLog = sessionSettings.GetBool(SessionSettings.FILE_LOG_ROTATE_ON_NEW_SESSION);

            if (sessionSettings.Has(SessionSettings.FILE_LOG_ROTATE_NUM_TO_KEEP))
                RotateLogNumToKeep = sessionSettings.GetInt(SessionSettings.FILE_LOG_ROTATE_NUM_TO_KEEP);

            return new FileLog(sessionSettings.GetString(SessionSettings.FILE_LOG_PATH), sessionID, RotateLog, RotateLogNumToKeep);
        }
开发者ID:mjwood7,项目名称:quickfixn,代码行数:19,代码来源:FileLogFactory.cs


示例8: FromApp

 public void FromApp(QuickFix.Message msg, SessionID sessionID)
 {
     Console.WriteLine("FromApp - " + msg.ToString() + "@" + sessionID.ToString());
     try
     {
         Crack(msg, sessionID);
     }
     catch (Exception ex)
     {
         Console.WriteLine("==Cracker exception==");
         Console.WriteLine(ex.ToString());
         Console.WriteLine(ex.StackTrace);
     }
 }
开发者ID:topomondher,项目名称:web_helper,代码行数:14,代码来源:BtcchinaFIX.cs


示例9: OnMessage

    public void OnMessage(MarketDataIncrementalRefresh msg, SessionID sessionID)
    {
        FIX44XMLParser parser = new FIX44XMLParser();

        Console.WriteLine("==========Header::==========");
        Console.WriteLine(parser.getFieldName(Tags.BeginString.ToString()) + ":: " + msg.Header.GetString(Tags.BeginString));
        Console.WriteLine(parser.getFieldName(Tags.BodyLength.ToString()) + ":: " + msg.Header.GetString(Tags.BodyLength));
        Console.WriteLine(parser.getFieldName(Tags.MsgType.ToString()) + ":: MarketDataIncrementalRefresh (" + msg.Header.GetString(Tags.MsgType) + ")");
        Console.WriteLine(parser.getFieldName(Tags.MsgSeqNum.ToString()) + ":: " + msg.Header.GetString(Tags.MsgSeqNum));
        Console.WriteLine(parser.getFieldName(Tags.SenderCompID.ToString()) + ":: " + msg.Header.GetString(Tags.SenderCompID));
        Console.WriteLine(parser.getFieldName(Tags.SendingTime.ToString()) + ":: " + msg.Header.GetString(Tags.SendingTime));
        Console.WriteLine(parser.getFieldName(Tags.TargetCompID.ToString()) + ":: " + msg.Header.GetString(Tags.TargetCompID));

        Console.WriteLine("==========Body:: ==========");
        Console.WriteLine(parser.getFieldName(Tags.NoMDEntries.ToString()) + ":: " + msg.GetString(Tags.NoMDEntries));

        MarketDataIncrementalRefresh.NoMDEntriesGroup g0 = new MarketDataIncrementalRefresh.NoMDEntriesGroup();
        for (int grpIndex = 1; grpIndex <= msg.GetInt(Tags.NoMDEntries); grpIndex += 1)
        {
            Console.WriteLine("---------- ----------");
            msg.GetGroup(grpIndex, g0);
            //				Console.WriteLine(parser.getFieldName(Tags.MDUpdateAction.ToString())+":: "+g0.GetString(Tags.MDUpdateAction));

            Console.WriteLine(parser.getFieldName(Tags.MDUpdateAction.ToString()) + ":: " +
                parser.getFieldName(Tags.MDUpdateAction.ToString(), g0.GetString(Tags.MDUpdateAction).ToString()) +
                "(" + g0.GetString(Tags.MDUpdateAction) + ")"
            );

            Console.WriteLine(parser.getFieldName(Tags.MDEntryType.ToString()) + ":: " +
                parser.getFieldName(Tags.MDEntryType.ToString(), g0.GetString(Tags.MDEntryType).ToString()) +
                "(" + g0.GetString(Tags.MDEntryType) + ")"
            );

            try
            {
                Console.WriteLine(parser.getFieldName(Tags.MDEntryPx.ToString()) + ":: " + g0.GetString(Tags.MDEntryPx));
            }
            catch (Exception ex)
            {
                Console.WriteLine(parser.getFieldName(Tags.MDEntrySize.ToString()) + ":: " + g0.GetString(Tags.MDEntrySize));
            }

            Console.WriteLine(parser.getFieldName(Tags.MDEntryDate.ToString()) + ":: " + g0.GetString(Tags.MDEntryDate));
            Console.WriteLine(parser.getFieldName(Tags.MDEntryTime.ToString()) + ":: " + g0.GetString(Tags.MDEntryTime));
        }

        Console.WriteLine("==========Trailer:: ==========");
        Console.WriteLine(parser.getFieldName(Tags.CheckSum.ToString()) + ":: " + msg.Trailer.GetString(Tags.CheckSum));
    }
开发者ID:topomondher,项目名称:web_helper,代码行数:49,代码来源:BtcchinaFIX.cs


示例10: FileLog

        public FileLog(string fileLogPath, SessionID sessionID)
        {
            sessionID_ = sessionID;

            if (!System.IO.Directory.Exists(fileLogPath))
                System.IO.Directory.CreateDirectory(fileLogPath);

            string fname = new System.Text.StringBuilder(sessionID_.BeginString)
                .Append('-').Append(sessionID_.SenderCompID)
                .Append('-').Append(sessionID_.TargetCompID)
                .Append(".fixme.log")
                .ToString();
            fname = System.IO.Path.Combine(fileLogPath, fname);
            file_ = new System.IO.StreamWriter(fname);
        }
开发者ID:kennystone,项目名称:quickfixn,代码行数:15,代码来源:FileLog.cs


示例11: Prefix

        public static string Prefix(SessionID sessionID)
        {
            System.Text.StringBuilder prefix = new System.Text.StringBuilder(sessionID.BeginString)
                .Append('-').Append(sessionID.SenderCompID);
            if (SessionID.IsSet(sessionID.SenderSubID))
                prefix.Append('_').Append(sessionID.SenderSubID);
            if (SessionID.IsSet(sessionID.SenderLocationID))
                prefix.Append('_').Append(sessionID.SenderLocationID);
            prefix.Append('-').Append(sessionID.TargetCompID);
            if (SessionID.IsSet(sessionID.TargetSubID))
                prefix.Append('_').Append(sessionID.TargetSubID);
            if (SessionID.IsSet(sessionID.TargetLocationID))
                prefix.Append('_').Append(sessionID.TargetLocationID);

            if(sessionID.SessionQualifier.Length!=0)
                prefix.Append('-').Append(sessionID.SessionQualifier);

            return prefix.ToString();
        }
开发者ID:Daniel-Svensson,项目名称:quickfixn,代码行数:19,代码来源:FileLog.cs


示例12: Create

        public ILog Create(SessionID sessionID)
        {
            bool logIncoming = logIncoming_;
            bool logOutgoing = logOutgoing_;
            bool logEvent    = logEvent_;

            if(settings_ != null && settings_.Has(sessionID))
            {
                Dictionary dict = settings_.Get(sessionID);
                if (dict.Has(SCREEN_LOG_SHOW_INCOMING))
                    logIncoming = dict.GetBool(SCREEN_LOG_SHOW_INCOMING);
                if (dict.Has(SCREEN_LOG_SHOW_OUTGOING))
                    logOutgoing = dict.GetBool(SCREEN_LOG_SHOW_OUTGOING);
                if (dict.Has(SCREEN_LOG_SHOW_EVENTS))
                    logEvent = dict.GetBool(SCREEN_LOG_SHOW_EVENTS);
            }

            return new ScreenLog(sessionID, logIncoming, logOutgoing, logEvent);
        }
开发者ID:RemiGaudin,项目名称:quickfixn,代码行数:19,代码来源:ScreenLogFactory.cs


示例13: testOrderSend

    public void testOrderSend()
    {
        SessionNotFound exception = null;
        NewOrderSingle order = new NewOrderSingle();
        try
        {
            Session.sendToTarget(order);
        }
        catch(SessionNotFound e)
        {
            exception = e;
        }
        Assert.IsNotNull( exception, "no exception thrown" );

        exception = null;
        SessionID sessionID = new SessionID
            ("FIX.4.2", "TW", "ISLD");
        order.set(new ClOrdID("12345"));
        order.set(new Symbol("LNUX"));
        order.set(new HandlInst('1'));
        order.set(new Side(Side.BUY));
        order.set(new OrdType(OrdType.MARKET));
        order.set(new TransactTime());

        try
        {
            Assert.IsTrue(Session.sendToTarget(order, sessionID));
            QuickFix.Message message = application.getMessage();
            Assert.IsNotNull(message, "Message not received");
            //Assert.IsTrue("Message not a NewOrderSingle",
            //           message instanceof NewOrderSingle);
            Assert.IsTrue(Session.sendToTarget(order, sessionID));
        }
        catch(SessionNotFound e)
        {
            exception = e;
        }
        Assert.IsNull(exception, "exception thrown");
    }
开发者ID:jaubrey,项目名称:quickfix,代码行数:39,代码来源:OrderTest.cs


示例14: FromApp

 public void FromApp(Message message, SessionID sessionID)
 {
 }
开发者ID:nisbus,项目名称:quickfixn,代码行数:3,代码来源:NullApplication.cs


示例15: Create

 /// <summary>
 /// Creates a file-based message store
 /// </summary>
 /// <param name="sessionID">session ID for the message store</param>
 /// <returns></returns>
 public ILog Create(SessionID sessionID)
 {
     return new FileLog(settings_.Get(sessionID).GetString(SessionSettings.FILE_LOG_PATH), sessionID);
 }
开发者ID:RemiGaudin,项目名称:quickfixn,代码行数:9,代码来源:FileLogFactory.cs


示例16: DoConnect

        protected override void DoConnect(SessionID sessionID, Dictionary settings)
        {
            Session session = null;

            try
            {
                session = Session.LookupSession(sessionID);
                if (!session.IsSessionTime)
                    return;

                IPEndPoint socketEndPoint = GetNextSocketEndPoint(sessionID, settings);
                SetPending(sessionID);
                session.Log.OnEvent("Connecting to " + socketEndPoint.Address + " on port " + socketEndPoint.Port);

                SocketInitiatorThread t = new SocketInitiatorThread(this, session, socketEndPoint, socketSettings_);
                t.Start();
                AddThread(t);

            }
            catch (System.Exception e)
            {
                if (null != session)
                    session.Log.OnEvent(e.Message);
            }
        }
开发者ID:robertpi,项目名称:quickfixn,代码行数:25,代码来源:SocketInitiator.cs


示例17: FromAdmin

 public void FromAdmin(Message message, SessionID sessionID)
 {
 }
开发者ID:nisbus,项目名称:quickfixn,代码行数:3,代码来源:NullApplication.cs


示例18: LookupSession

 /// <summary>
 /// Looks up a Session by its SessionID
 /// </summary>
 /// <param name="sessionID">the SessionID of the Session</param>
 /// <returns>the Session if found, else returns null</returns>
 public static Session LookupSession(SessionID sessionID)
 {
     Session result;
     lock (sessions_)
     {
         if (!sessions_.TryGetValue(sessionID, out result))
             result = null;
     }
     return result;
 }
开发者ID:javagg,项目名称:kingstar_csharp_sdk,代码行数:15,代码来源:Session.cs


示例19: 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);
            }
        }
开发者ID:robertpi,项目名称:quickfixn,代码行数:27,代码来源:SocketInitiator.cs


示例20: SendToTarget

 /// <summary>
 /// Sends a message to the session specified by the provider session ID.
 /// </summary>
 /// <param name="message">FIX message</param>
 /// <param name="sessionID">target SessionID</param>
 /// <returns>true if send was successful, false otherwise</returns>
 public static bool SendToTarget(Message message, SessionID sessionID)
 {
     message.SetSessionID(sessionID);
     Session session = Session.LookupSession(sessionID);
     if (null == session)
         throw new SessionNotFound(sessionID);
     return session.Send(message);
 }
开发者ID:javagg,项目名称:kingstar_csharp_sdk,代码行数:14,代码来源:Session.cs



注:本文中的SessionID类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SessionInfo类代码示例发布时间:2022-05-24
下一篇:
C# SessionFactory类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap