Git Product home page Git Product logo

Comments (6)

kwitee avatar kwitee commented on July 21, 2024

I tried to debug both old and new solutions, here are my results:
Old .NET QuickFix wrapper:

  • OnCreate event is called after calling the constructor of initiator,
  • calling start method
  • toAdmin event fires and initiates the connection - with the new API this event is never called so I guess there is some kind of socket error but no exceptions are called.

from quickfixn.

kwitee avatar kwitee commented on July 21, 2024

I think I found the error in method SocketInitiator.OnStart:

Environment.TickCount is returning negative number on my system so the Connect method is never called.
I think this should be considered as bug since TickCount can return negative number:

"The value of this property is derived from the system timer and is stored as a 32-bit signed integer. Consequently, if the system runs continuously, TickCount will increment from zero to Int32.MaxValue for approximately 24.9 days, then jump to Int32.MinValue, which is a negative number, then increment back to zero during the next 24.9 days."
Source: http://msdn.microsoft.com/en-us/library/system.environment.tickcount.aspx

from quickfixn.

kwitee avatar kwitee commented on July 21, 2024

Simple solution should fix this issue (my connection work after this change):

    protected override void OnStart()
    {
        shutdownRequested_ = false;

        while(!shutdownRequested_)
        {
            int reconnectIntervalAsTicks = 1000 * reconnectInterval_;
            int nowTickCount = Environment.TickCount;
            if (nowTickCount < 0)
                nowTickCount *= -1;

            if ((nowTickCount - lastConnectTickCount) >= reconnectIntervalAsTicks)
            {
                Connect();
                lastConnectTickCount = nowTickCount;
            }

            Thread.Sleep(1 * 1000);
        }
    }

from quickfixn.

gbirchmeier avatar gbirchmeier commented on July 21, 2024

Dupe of #42.

By the way, the proper avenue for help is the mailing list.
http://quickfixn.org/help

Issues are for bug and new-feature tracking.

from quickfixn.

kwitee avatar kwitee commented on July 21, 2024

Thanks for answer. Next time I will use the mailing list. But to be accurate, it was a bug after all ;-) but it taked me more time to realize it...

from quickfixn.

gbirchmeier avatar gbirchmeier commented on July 21, 2024

No problem :)

from quickfixn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.