Пример #1
0
        void IServerSetup.ServerSetup()
        {
            MqS ftr = ServiceGetFilter();

            ServiceCreate("+ALL", Filter);
            ftr.ServiceCreate("+ALL", Filter);
        }
Пример #2
0
 void IEvent.Event()
 {
     if (itms.Count <= 0)
     {
         ErrorSetCONTINUE();
     }
     else
     {
         MqDumpS dump = itms.Peek();
         try  {
             MqS ftr = ServiceGetFilter();
             ftr.LinkConnect();
             ReadForward(ftr, dump);
         } catch (Exception ex) {
             ErrorSet(ex);
             if (ErrorIsEXIT())
             {
                 ErrorReset();
                 return;
             }
             else
             {
                 ErrorWrite();
             }
         }
         itms.Dequeue();
     }
 }
Пример #3
0
        private void ROUT()
        {
            String cmd = ReadC();

            SendSTART();
            if (cmd == "Create")
            {
                int id = ReadI();
                SlaveWorker(id, "--name", "wk-cl-" + id, "@", "--name", "wk-sv-" + id, "--factory", ReadC());
            }
            else if (cmd == "Ident")
            {
                SendC(FactoryCtxIdentGet());
            }
            else if (cmd == "Resolve")
            {
                // Resolve-Example for C#
                foreach (MqS myctx in MqS.Resolve(ReadC()))
                {
                    SendC(myctx.LinkGetTargetIdent());
                }
            }
            else
            {
                SendC("unknown");
            }
            SendRETURN();
        }
Пример #4
0
 void IEvent.Event()
 {
     if (StorageCount() == 0)
     {
         ErrorSetCONTINUE();
     }
     else
     {
         long Id = 0L;
         try  {
             MqS ftr = ServiceGetFilter();
             ftr.LinkConnect();
             Id = StorageSelect();
             ReadForward(ftr);
         } catch (Exception ex) {
             ErrorSet(ex);
             if (ErrorIsEXIT())
             {
                 ErrorReset();
                 return;
             }
             else
             {
                 ErrorWrite();
             }
         }
         StorageDelete(Id);
     }
 }
Пример #5
0
 void IEvent.Event()
 {
     if (itms.Count > 0)
     {
         FilterItmS it = itms.Peek();
         try  {
             MqS ftr = ServiceGetFilter();
             ftr.SendSTART();
             ftr.SendBDY(it.bdy);
             if (it.isTransaction)
             {
                 ftr.SendEND_AND_WAIT(it.token);
             }
             else
             {
                 ftr.SendEND(it.token);
             }
         } catch (Exception ex) {
             ErrorSet(ex);
             ErrorPrint();
             ErrorReset();
         } finally {
             itms.Dequeue();
         }
     }
     else
     {
         ErrorSetCONTINUE();
     }
 }
Пример #6
0
        void IServerSetup.ServerSetup()
        {
            MqS ftr = ServiceGetFilter();

            ServiceProxy("+ALL");
            ServiceProxy("+TRT");
            ftr.ServiceProxy("+ALL");
            ftr.ServiceProxy("+TRT");
        }
Пример #7
0
        void IBgError.BgError()
        {
            MqS master = SlaveGetMaster();

            if (master != null)
            {
                master.ErrorC("BGERROR", ErrorGetNum(), ErrorGetText());
                master.SendERROR();
            }
        }
Пример #8
0
        void IService.Service(MqS ctx)
        {
            FilterItmS it;

            it.token         = ServiceGetToken();
            it.isTransaction = ServiceIsTransaction();
            it.bdy           = ReadBDY();
            itms.Enqueue(it);
            SendRETURN();
        }
Пример #9
0
        void IBgError.Call()
        {
            MqS master = ConfigGetMaster();

            if (master != null)
            {
                master.ErrorC("BGERROR", ErrorGetNum(), ErrorGetText());
                master.SendERROR();
            }
        }
Пример #10
0
        void FTR()
        {
            MqS ftr = ServiceGetFilter();

            ftr.SendSTART();
            while (ReadItemExists())
            {
                ftr.SendC("<" + ReadC() + ">");
            }
            ftr.SendEND_AND_WAIT("+FTR");
            SendRETURN();
        }
Пример #11
0
        public void INIT()
        {
            int max = ReadGetNumItems();

            string[] list = new string[max];
            SendSTART();
            for (int i = 0; i < max; i++)
            {
                list[i] = ReadC();
            }
            MqS.Init(list);
            SendRETURN();
        }
Пример #12
0
        void LOGF()
        {
            MqS ftr = ServiceGetFilter();

            if (ftr.LinkGetTargetIdent() == "transFilter")
            {
                ReadForward(ftr);
            }
            else
            {
                FH = File.AppendText(ReadC());
            }
            SendRETURN();
        }
Пример #13
0
        void FTR()
        {
            MqS ftr = ServiceGetFilter();

            ftr.SendSTART();
            ftr.SendC("F3");
            ftr.SendC(ftr.ConfigGetName());
            ftr.SendI((int)ftr.ConfigGetStartAs());
            ftr.SendI(ConfigGetStatusIs());
            while (ReadGetNumItems() != 0)
            {
                ftr.SendC(ReadC());
            }
            ftr.SendEND_AND_WAIT("+FTR");
            SendRETURN();
        }
Пример #14
0
        // service definition
        void EOF()
        {
            MqS ftr = ServiceGetFilter();

            foreach (List <string> d in data)
            {
                ftr.SendSTART();
                foreach (string s in d)
                {
                    ftr.SendC(s);
                }
                ftr.SendEND_AND_WAIT("+FTR");
            }
            ftr.SendSTART();
            ftr.SendEND_AND_WAIT("+EOF");
            SendRETURN();
        }
Пример #15
0
        public static void Main(string[] argv)
        {
            MqFactoryS <F1> .Add();

            MqFactoryS <F2> .Add();

            MqFactoryS <F3> .Add();

            MqS srv = MqFactoryS <MqS> .Call(argv[0]);

            try {
                srv.LinkCreate(argv);
                srv.ProcessEvent(MqS.WAIT.FOREVER);
            } catch (Exception ex) {
                srv.ErrorSet(ex);
            }
            srv.Exit();
        }
Пример #16
0
        // service definition
        void Filter()
        {
            MqS ftr = ServiceGetFilter();

            ftr.SendSTART();
            ftr.SendBDY(ReadBDY());
            if (ServiceIsTransaction())
            {
                ftr.SendEND_AND_WAIT(ServiceGetToken());
                SendSTART();
                SendBDY(ftr.ReadBDY());
            }
            else
            {
                ftr.SendEND(ServiceGetToken());
            }
            SendRETURN();
        }
Пример #17
0
 void IService.Service(MqS ctx)
 {
     itms.Enqueue(ReadDUMP());
     SendRETURN();
 }
Пример #18
0
 public mulserver(MqS tmpl) : base(tmpl)
 {
     ConfigSetIsServer(true);
 }
Пример #19
0
 public Filter4(MqS tmpl) : base(tmpl)
 {
 }
Пример #20
0
        // ########################################################################

        public Server(MqS tmpl) : base(tmpl)
        {
        }
Пример #21
0
 void IService.Service(MqS ctx)
 {
     StorageInsert();
     SendRETURN();
 }
Пример #22
0
        public void SND2()
        {
            string s  = ReadC();
            int    id = ReadI();
            MqS    cl = SlaveGet(id);

            SendSTART();
            if (s == "CREATE")
            {
                List <string> LIST = new List <string>();
                while (ReadItemExists())
                {
                    LIST.Add(ReadC());
                }
                LIST.Add("--name");
                LIST.Add("wk-cl-" + id);
                LIST.Add("@");
                LIST.Add("--name");
                LIST.Add("wk-sv-" + id);
                SlaveWorker(id, LIST.ToArray());
            }
            else if (s == "CREATE2")
            {
                Client c = new Client();
                c.LinkCreate(ConfigGetDebug());
                SlaveCreate(id, c);
            }
            else if (s == "CREATE3")
            {
                ClientERR c = new ClientERR();
                c.LinkCreate(ConfigGetDebug());
                SlaveCreate(id, c);
            }
            else if (s == "DELETE")
            {
                SlaveDelete(id);
                SendC(SlaveGet(id) == null ? "OK" : "ERROR");
            }
            else if (s == "SEND")
            {
                cl.SendSTART();
                String TOK = ReadC();
                ReadProxy(cl);
                cl.SendEND(TOK);
            }
            else if (s == "WAIT")
            {
                cl.SendSTART();
                cl.SendN(ReadN());
                cl.SendEND_AND_WAIT("ECOI", 5);
                SendI(cl.ReadI() + 1);
            }
            else if (s == "CALLBACK")
            {
                cl.SendSTART();
                ReadProxy(cl);
                i = -1;
                cl.SendEND_AND_CALLBACK("ECOI", ((Server)cl).SetMyInt);
                cl.ProcessEvent(10, MqS.WAIT.ONCE);
                SendI(i + 1);
            }
            else if (s == "MqSendEND_AND_WAIT")
            {
                string TOK = ReadC();
                cl.SendSTART();
                while (ReadItemExists())
                {
                    ReadProxy(cl);
                }
                cl.SendEND_AND_WAIT(TOK, 5);
                while (cl.ReadItemExists())
                {
                    cl.ReadProxy(this);
                }
            }
            else if (s == "MqSendEND")
            {
                string TOK = ReadC();
                cl.SendSTART();
                while (ReadItemExists())
                {
                    ReadProxy(cl);
                }
                cl.SendEND(TOK);
                return;
            }
            else if (s == "ERR-1")
            {
                ClientERR2 c = new ClientERR2();
                c.LinkCreate(ConfigGetDebug());
            }
            else if (s == "isSlave")
            {
                SendO(cl.SlaveIs());
            }
            SendRETURN();
        }
Пример #23
0
 // constructor
 public Filter1(MqS tmpl) : base(tmpl)
 {
     ConfigSetIsServer(true);
 }
Пример #24
0
 public testserver(MqS tmpl) : base(tmpl)
 {
 }
Пример #25
0
 public F1(MqS tmpl) : base(tmpl)
 {
 }
Пример #26
0
 public F2(MqS tmpl) : base(tmpl)
 {
 }
Пример #27
0
 public F3(MqS tmpl) : base(tmpl)
 {
 }
Пример #28
0
 void IService.Service(MqS ctx)
 {
     ctx.SendSTART();
     ctx.SendW(ctx.ReadW());
     ctx.SendRETURN();
 }
Пример #29
0
 public manfilter(MqS tmpl) : base(tmpl)
 {
 }