Example #1
0
            public void onBookClear(
				MamdaSubscription        sub,
				MamdaOrderBookListener   listener,
				MamaMsg                  msg,
				MamdaOrderBookDelta      bookDelta,
				MamdaOrderBookRecap      fullBook)
            {
                if (myQuietModeLevel < 2)
                {
                    Console.WriteLine ("CLEAR!!!  (seq# {0}) ", msg.getSeqNum());
                }
            }
Example #2
0
            public void onBookRecap(
				MamdaSubscription        sub,
				MamdaOrderBookListener   listener,
				MamaMsg                  msg,
				MamdaOrderBookDelta      bookDelta,
				MamdaOrderBookRecap      bookRecap)
            {
                if (myQuietModeLevel < 2)
                {
                    Console.WriteLine ("RECAP!!!  (seq# {0}) ", msg.getSeqNum());
                }

                if (myCacheFullBooks)
                {
                    prettyPrint(bookRecap.getFullOrderBook());
                }
                else
                {
                    prettyPrint(bookDelta.getDeltaOrderBook());
                }
            }
Example #3
0
            public void onBookClear(
				MamdaSubscription        sub,
				MamdaOrderBookListener   listener,
				MamaMsg                  msg,
				MamdaOrderBookDelta      bookDelta,
				MamdaOrderBookRecap      fullBook)
            {
                Console.WriteLine("BookClear");
            }
Example #4
0
            public void onBookRecap(
				MamdaSubscription        sub,
				MamdaOrderBookListener   listener,
				MamaMsg                  msg,
				MamdaOrderBookDelta      bookDelta,
				MamdaOrderBookRecap      bookRecap)
            {
                ++myRecapStats;
            }
Example #5
0
            public void onBookRecap(
				MamdaSubscription        subscription,
				MamdaOrderBookListener   listener,
				MamaMsg                  msg,
				MamdaOrderBookDelta      delta,
				MamdaOrderBookRecap      recap)
            {
                outer_.OnBookRecapCallback(subscription, listener, msg, delta, recap);
            }
Example #6
0
            public void onBookDelta(MamdaSubscription        subscription,
				MamdaOrderBookListener   listener,
				MamaMsg                  msg,
				MamdaOrderBookDelta      delta,
				MamdaOrderBookRecap      fullBook)
            {
                // Will not be called for a snapshot sub
            }
Example #7
0
            public void onBookRecap(
				MamdaSubscription subscription,
				MamdaOrderBookListener listener,
				MamaMsg msg,
				MamdaOrderBookDelta delta,
				MamdaOrderBookRecap recap)
            {
            }
Example #8
0
            public void onBookClear(
				MamdaSubscription subscription,
				MamdaOrderBookListener listener,
				MamaMsg msg,
				MamdaOrderBookDelta delta,
				MamdaOrderBookRecap fullBook)
            {
            }
Example #9
0
        internal void OnBookRecapCallback(
			MamdaSubscription subscription,
			MamdaOrderBookListener listener,
			MamaMsg msg,
			MamdaOrderBookDelta delta,
			MamdaOrderBookRecap recap)
        {
            long snappedSeqNum  = listener.getSeqNum ();
            long realTimeSeqNum = mRealTimeListener.getSeqNum ();

            MamdaOrderBook fullBook = recap.getFullOrderBook();

            if (snappedSeqNum != realTimeSeqNum)
            {
                mInconclusiveCount++;
                if (mHandler != null)
                {
                    string reason ="sequence numbers differ (" + snappedSeqNum + "!=" + realTimeSeqNum;
                    mHandler.onInconclusive(MamdaOrderBookCheckType.SNAPSHOT, reason);
                }
            }
            else
            {
                try
                {
                    fullBook.assertEqual(mRealTimeListener.getFullOrderBook());
                    mSuccessCount++;
                    if (mHandler != null)
                    {
                        mHandler.onSuccess(MamdaOrderBookCheckType.APPLY_DELTA);
                    }
                }
                catch (MamdaOrderBookException e)
                {
                    mFailureCount++;
                    if (mHandler != null)
                    {
                        mHandler.onFailure(MamdaOrderBookCheckType.SNAPSHOT,
                            e.ToString(),
                            msg,
                            mRealTimeListener.getFullOrderBook(),
                            fullBook);
                    }
                }
            }
            //Deactivate the subscription
            mSnapShotListener.clear();
            mSnapShotSubsc.deactivate();
        }