Example #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     using (localhost.MessagingServiceClient m_proxy = new localhost.MessagingServiceClient())
     {
         m_proxy.SendMessage(string.Format("Hello from {0}", this.Text));
     }
 }
Example #2
0
        public Form1()
        {
            InitializeComponent();
            this.Text += ": Process " + Process.GetCurrentProcess().Id.ToString();

            m_proxy = new localhost.MessagingServiceClient();
            ICommunicationObject obj = m_proxy as ICommunicationObject;

            obj.Faulted += new EventHandler(obj_Faulted);
        }
Example #3
0
        public Form1()
        {
            InitializeComponent();
            this.Text += ": ThreadId " + Thread.CurrentThread.GetHashCode().ToString();


            MessagingServiceCallback callbackType = new MessagingServiceCallback();
            InstanceContext          context      = new InstanceContext(callbackType);

            m_proxy = new localhost.MessagingServiceClient(context);
        }
Example #4
0
 void obj_Faulted(object sender, EventArgs e)
 {
     MessageBox.Show("Communication channel has faulted. Creating a new proxy instance.");
     m_proxy = new localhost.MessagingServiceClient();
 }