Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // start up the WPF application
- // set the handler for the Checked event
- ToggleButton channelButton1 = new ToggleButton();
- channelButton1.Checked += (s, e) =>
- ThreadPool.QueueUserWorkItem(SetTcpChannel, 1);
- try
- {
- int channel = (int)state;
- EnsureTcpSocket();
- // more logic to do stuff with channel
- // that we don't care about for SO
- ...
- }
- catch (Exception e)
- {
- // just for illustration
- // this is where I expected the code to return
- ...
- }
- if (_tcp == null)
- {
- // this is not a valid ip/port since the
- // target machine is not running (test condition)
- // but that's ok, I should get some exception
- // and continue debugging...right?
- _tcp = new TcpClient(ip, port);
- }
Add Comment
Please, Sign In to add comment