Exemplo n.º 1
0
        public FortsTrade()
        {
            try
            {
                Plaza = new MPlaza();
                Plaza.Init();

                if (connection != null)
                    connection.Dispose();
                if (listener != null)
                    listener.Dispose();
                if (pub != null)
                    pub.Dispose();

                connection = new Connection("p2tcp://127.0.0.1:4001;app_name=FT");

                pub = new Publisher(connection, "p2mq://FORTS_SRV;category=FORTS_MSG;name=Pub;timeout=5000");

                listener = new Listener(connection, "p2mqreply://;ref=Pub;scheme=|FILE|Ini\\FutMsg.ini|FutMsg");
                listener.Handler += new Listener.MessageHandler(MessageHandlerAggr);
                lisPubReplState = "";

                ConnState = State.Closed;
                ListState = State.Closed;
                PubState = State.Closed;
                errMessage = "";
            }
            catch (Exception err)
            {
                ConnState = State.Closed;
                ListState = State.Closed;

                if (pub != null)
                    pub.Dispose();
                if (connection != null)
                    connection.Dispose();
                if (listener != null)
                    listener.Dispose();

                Plaza.Deinit();

                errMessage = err.Message;
                throw err;
            }
        }
Exemplo n.º 2
0
        public CurrDrinks()
        {
            try
            {
                Plaza = new MPlaza();
                Plaza.Init();

                if (connection != null)
                    connection.Dispose();
                if (listener != null)
                    listener.Dispose();

                connection = new Connection("p2tcp://127.0.0.1:4001;app_name=CDR123");

                listener = new Listener(connection, "p2repl://MCXCC_AGGR_REPL;scheme=|FILE|Ini\\CurrDrink.ini|CurrDrink");
                listener.Handler += new Listener.MessageHandler(MessageHandlerInfo);
                listenerReplState = "";

                ConnState = State.Closed;
                ListState = State.Closed;
                errMessage = "";
            }
            catch (Exception err)
            {
                ConnState = State.Closed;
                ListState = State.Closed;

                if (connection != null)
                    connection.Dispose();
                if (listener != null)
                    listener.Dispose();

                Plaza.Deinit();

                errMessage = err.Message;
                throw err;
            }
        }
Exemplo n.º 3
0
        public SpotCommon()
        {
            try
            {
                Plaza = new MPlaza();
                Plaza.Init();

                if (connection != null)
                    connection.Dispose();
                if (listener != null)
                    listener.Dispose();

                connection = new Connection("p2tcp://127.0.0.1:4001;app_name=SC321");

                listener = new Listener(connection, "p2repl://MCXSPOT_MDCOMMON_REPL");//;scheme=|FILE|Ini\\SpotCommon.ini|SpotCommon");
                listener.Handler += new Listener.MessageHandler(MessageHandlerInfo);
                listenerReplState = "";

                ConnState = State.Closed;
                ListState = State.Closed;
                errMessage = "";
            }
            catch (Exception err)
            {
                ConnState = State.Closed;
                ListState = State.Closed;

                if (connection != null)
                    connection.Dispose();
                if (listener != null)
                    listener.Dispose();

                Plaza.Deinit();

                errMessage = err.Message;
                throw err;
            }
        }
Exemplo n.º 4
0
        public FortsCommon()
        {
            try
            {
                Plaza = new MPlaza();
                Plaza.Init();

                if (connection != null)
                    connection.Dispose();
                if (listener != null)
                    listener.Dispose();

                connection = new Connection("p2tcp://127.0.0.1:4001;app_name=FC");

                listener = new Listener(connection, "p2repl://FORTS_FUTCOMMON_REPL;scheme=|FILE|Ini\\FutComm.ini|FutComm");
                listener.Handler += new Listener.MessageHandler(MessageHandlerComm);
                lisFutCommReplState = "";

                ConnState = State.Closed;
                ListState = State.Closed;
                errMessage = "";
            }
            catch (Exception err)
            {
                ConnState = State.Closed;
                ListState = State.Closed;

                if (connection != null)
                    connection.Dispose();
                if (listener != null)
                    listener.Dispose();

                Plaza.Deinit();

                errMessage = err.Message;
                throw err;
            }
        }
Exemplo n.º 5
0
        public FortsDrinks(int Depth)
        {
            try
            {
                Plaza = new MPlaza();
                Plaza.Init();

                if (connection != null)
                    connection.Dispose();
                if (listener != null)
                    listener.Dispose();

                connection = new Connection("p2tcp://127.0.0.1:4001;app_name=FDR");

                listener = new Listener(connection, "p2repl://FORTS_FUTAGGR" + Depth + "_REPL;scheme=|FILE|Ini\\FutAggr.ini|FutAggr");
                listener.Handler += new Listener.MessageHandler(MessageHandlerAggr);
                lisFutAggrReplState = "";

                ConnState = State.Closed;
                ListState = State.Closed;
                errMessage = "";
            }
            catch (Exception err)
            {
                ConnState = State.Closed;
                ListState = State.Closed;

                if (connection != null)
                    connection.Dispose();
                if (listener != null)
                    listener.Dispose();

                Plaza.Deinit();

                errMessage = err.Message;
                throw err;
            }
        }
Exemplo n.º 6
0
        public FortsInfo()
        {
            try
            {
                Plaza = new MPlaza();
                Plaza.Init();

                if (connection != null)
                    connection.Dispose();
                if (lisFutInfo != null)
                    lisFutInfo.Dispose();
                if (lisFutPos != null)
                    lisFutPos.Dispose();
                if (lisFutPart != null)
                    lisFutPart.Dispose();
                if (lisFutVM != null)
                    lisFutVM.Dispose();

                connection = new Connection("p2tcp://127.0.0.1:4001;app_name=FI");

                lisFutInfo = new Listener(connection, "p2repl://FORTS_FUTINFO_REPL;scheme=|FILE|Ini\\FutInfo.ini|FutInfo");
                lisFutInfo.Handler += new Listener.MessageHandler(MessageHandlerInfo);
                lisFutInfoReplState = "";

                lisFutPos = new Listener(connection, "p2repl://FORTS_POS_REPL;scheme=|FILE|Ini\\FutPos.ini|FutPos");
                lisFutPos.Handler += new Listener.MessageHandler(MessageHandlerPos);
                lisFutPosReplState = "";

                lisFutPart = new Listener(connection, "p2repl://FORTS_PART_REPL;scheme=|FILE|Ini\\FutPart.ini|FutPart");
                lisFutPart.Handler += new Listener.MessageHandler(MessageHandlerPart);
                lisFutPartReplState = "";

                lisFutVM = new Listener(connection, "p2repl://FORTS_VM_REPL;scheme=|FILE|Ini\\FutVM.ini|FutVM");
                lisFutVM.Handler += new Listener.MessageHandler(MessageHandlerVM);
                lisFutVMReplState = "";

                ConnState = State.Closed;
                ListInfoState = State.Closed;
                ListPosState = State.Closed;
                ListPartState = State.Closed;
                ListVMState = State.Closed;
                errMessage = "";
            }
            catch (Exception err)
            {
                ConnState = State.Closed;
                ListInfoState = State.Closed;
                ListPosState = State.Closed;
                ListPartState = State.Closed;
                ListVMState = State.Closed;

                if (connection != null)
                    connection.Dispose();
                if (lisFutInfo != null)
                    lisFutInfo.Dispose();
                if (lisFutPos != null)
                    lisFutPos.Dispose();
                if (lisFutPart != null)
                    lisFutPart.Dispose();
                if (lisFutVM != null)
                    lisFutVM.Dispose();

                Plaza.Deinit();

                errMessage = err.Message;
                throw err;
            }
        }