Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#2.0 C#3.0 C# C#4.0
i was doing a project on remote desktop where a server can view 3 clients (3 form in a project ) but i get a exception which makes me to view one client at a time
 
form1
 
TcpChannel chan1 = new TcpChannel();
 
  ChannelServices.RegisterChannel(chan1, false);
 
form 2
 
TcpChannel chan1 = new TcpChannel();
 ChannelServices.RegisterChannel(chan1, false);
 

here i was able to view only one form and if i connect with another i get a exception please help
Posted 22-Nov-11 20:48pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Maybe I didn't undertand you, but I think, it's not hard and you have many solutions - bad (like use try-catch RemotingException directly in code) or not good (create singletone that wraps work with TcpChannel)
 
TcpChannel chan1 = new TcpChannel();
try
{
 ChannelServices.RegisterChannel(chan1, false);
}
catch(RemotingException ex)
{
  //all good, nobody cares, but we log it
}
  Permalink  
Comments
SAKryukov at 23-Nov-11 12:33pm
   
So, you offer "bad" and "not good" solutions (your first sentence). Is there any good? :-)
--SA
Nickos_me at 24-Nov-11 1:46am
   
I think that good - it's refactor code of whole program and review architecture, because if question like that is raised that there some big problems in solution :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 23 Nov 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100