Exemplo n.º 1
0
        static void Main(string[] args)
        {
            MllpSend mllpSend = new MllpSend("localhost", 11000);
            mllpSend.AckNackReceived += new Action<HL7Message, HL7Message>(mllpSend_AckNackReceived);
            mllpSend.ErrorHandler += new Action<Exception, HL7Message>(mllpSend_ErrorHandler);

            mllpSend.AckNackRequired = true;

            Console.WriteLine("Starting");

            for (int i = 0; i< 100; i++)
                mllpSend.SendAsync(new HL7Message(HL7 + " " + i.ToString()));

            Console.WriteLine("Done");
            Console.ReadLine();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            MllpSend mllpSend = new MllpSend("10.160.33.122", 44000);

            mllpSend.SendAsync(new HL7Message(new byte[] { 10, 11, 12 }));

            ////Mllp mllp = new Mllp("10.160.97.95", 16000);
            //Mllp mllp = new Mllp();

            //mllp.Hl7AckNackReceived += new Action<byte[]>(mllp_AckNackReceived);
            //mllp.Hl7MessageReceived += new Action<byte[]>(mllp_Level2AckNackReceived);
            //mllp.ErrorHandler += new Action<string>(mllp_ErrorHandler);

            //mllp.StartListening(11000);

            //mllp.MllpHostPort = 16000;
            //mllp.MllpHostAddress = "10.160.97.95";
            //bool sent = mllp.SendAsync(ASCIIEncoding.ASCII.GetBytes(HL7));
            //ackNackReceived.WaitOne();
            Console.ReadLine();

            //mllp.StopListening();
        }