예제 #1
0
        public YZXMessagingClient(string partner,
                                  YZXMessagesFactoryType messagetype = YZXMessagesFactoryType.Duplex)
        {
            Partner = partner;

            DSender = DSenderFactory.CreateDuplexTypedMessageSender <ResponseType, RequestType>();

            anOutputChannel = UnderlyingMessaging.CreateDuplexOutputChannel(Partner);



            ConfigSender();

            AttachOutputChannel();
        }
예제 #2
0
 public void AttachOutputChannel()
 {
     try
     {
         switch (MessagesFactoryType)
         {
         case YZXMessagesFactoryType.Duplex:
             if (DSender == null)
             {
                 ConfigSender();
             }
             else
             {
                 if (DSender.IsDuplexOutputChannelAttached)
                 {
                 }
                 else
                 {
                     try
                     {
                         anOutputChannel = UnderlyingMessaging.CreateDuplexOutputChannel(Partner);
                         DSender.AttachDuplexOutputChannel(anOutputChannel);
                     }
                     catch (Exception ex)
                     {
                         Console.WriteLine(ex);
                     }
                 }
             }
             break;
         }
     }
     catch (Exception EX)
     {
         Console.WriteLine(EX);
     }
 }