예제 #1
0
        public virtual bool Initialize(HL7Server server, IHL7Protocol protocol)
        {
            server.Logger.Debug("the Client side is initializing");

            if (protocol.Config == null)
            {
                throw new ArgumentNullException("The configuration proprty is missing for this protocol");
            }

            m_HL7Protocol = protocol as HL7ProtocolBase;

            if (m_HL7Protocol == null)
            {
                return(false);
            }

            m_HL7Server = server;

            m_LocalEndpoint = new IPEndPoint(IPAddress.Parse(m_HL7Server.Config.Ip), m_HL7Server.Config.Port);

            m_EasyClient.Initialize(new ReceiverFilter(m_HL7Protocol), (request) =>
            {
                if (request.Request.IsAcknowledge)
                {
                    ProcessIncomingAck(request.Request);
                }
                else
                {
                    ProcessIncomingRequest(request);
                }
            });

            NewRequestReceived += OnNewRequestReceived;

            return(true);
        }
예제 #2
0
 public ReceiverFilter(IHL7Protocol protocol, byte[] begin, byte[] end) : base(begin, end)
 {
     this.protocol = protocol;
 }
 public MLLPBeginEndMarkReceiveFilter(IHL7Protocol protocol, byte[] begin, byte[] end) : base(begin, end)
 {
     this.m_Protocol = protocol;
 }
예제 #4
0
 public ReceiverFilter(IHL7Protocol protocol)
     : base(BeginMark, EndMark)
 {
     this.protocol = protocol;
 }
 public MLLPBeginEndMarkReceiveFilter() : base(beginMark, endMark)
 {
     m_Protocol = new HL7ProtocolBase();
 }