//----< get Receiver and Sender running >---------------------------- void setupChannel() { rcvr = new Receiver(localPort, localAddress); Action serviceAction = () => { try { Message rmsg = null; while (true) { rmsg = rcvr.getMessage(); Action act = () => { postRcvMsg(rmsg.content); }; Dispatcher.Invoke(act, System.Windows.Threading.DispatcherPriority.Background); } } catch (Exception ex) { Action act = () => { lStat.Text = ex.Message; }; Dispatcher.Invoke(act); } }; if (rcvr.StartService()) { rcvr.doService(serviceAction); } sndr = new wpfSender(lStat, this.Dispatcher); }
void setupChannel() { rcvr = new Receiver(localPort, localAddress); Action serviceAction = () => { try { while (true) { Action act = () => { displayPerformanceDetails(sndr.GetPerformanceDetails()); }; Dispatcher.Invoke(act, System.Windows.Threading.DispatcherPriority.Background); } } catch (Exception ex) { Action act = () => { rStat.Text = ex.Message; }; Dispatcher.Invoke(act); } }; if (rcvr.StartService()) { rcvr.doService(serviceAction); } sndr = new wpfSender(rStat, this.Dispatcher); }
void setupChannel() { try { rcvr = new Receiver(localPort, localAddress); Action serviceAction = () => { try { Message rmsg = null; while (true) { rmsg = rcvr.getMessage(); Action act = () => { postRcvMsg(rmsg.content, rmsg.fromUrl); }; Dispatcher.Invoke(act, System.Windows.Threading.DispatcherPriority.Background); } } catch (Exception ex) { Action act = () => { lblError.Content = ex.Message; }; Dispatcher.Invoke(act); } }; if (rcvr.StartService()) { rcvr.doService(serviceAction); } TextBox lStat = new TextBox(); sndr = new wpfSender(lStat, this.Dispatcher); } catch (CustomException wx) { Console.Write("Error in WPF client : {0}\n", wx.Message); } }
//----< get Receiver and Sender running >---------------------------- void setupChannel() { rcvr = new Receiver(localPort, localAddress); Action serviceAction = () => { try { Message rmsg = null; while (true) { rmsg = rcvr.getMessage(); Action act = () => { postRcvMsg(rmsg.content); }; Dispatcher.Invoke(act, System.Windows.Threading.DispatcherPriority.Background); } } catch(Exception ex) { Action act = () => { lStat.Text = ex.Message; }; Dispatcher.Invoke(act); } }; if (rcvr.StartService()) { rcvr.doService(serviceAction); } sndr = new wpfSender(lStat, this.Dispatcher); }