Click here to Skip to main content
15,904,416 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

1 solution

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)

C#
TcpChannel chan1 = new TcpChannel();
try
{
 ChannelServices.RegisterChannel(chan1, false);
}
catch(RemotingException ex)
{
  //all good, nobody cares, but we log it
}
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 23-Nov-11 12:33pm    
So, you offer "bad" and "not good" solutions (your first sentence). Is there any good? :-)
--SA
Nickos_me 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900