Click here to Skip to main content
15,890,186 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi there
I implemented a server/client app in c# that use .net remoting for communication between the clients and server. I use the client activated object in the server side because I want the server save the states of each clients.
I configure the TCP channel and register the remote object in the server. Now I want that in the server use the data that calculated in clients.
I use the following code in the server:
C#
RemotingConfiguration.Configure("Server.exe.config", true);
var remoteObj = Activator.GetObject(typeof(RemoteObject), "tcp://localhost:6791/Callback") as RemoteObject;
if (remoteObj != null)
{
    // When I run the server, this line throw an exception
    // The error msg is: Requested Service not found
    remoteObj.AgentAdded += remoteObj_AgentAdded;
}

I use the following code in client side:
C#
RemotingConfiguration.Configure("Client.exe.config", true);
var remObj = new RemoteObject();

remObj.Add("Agent 1"); // The Add method fire the AgentAdded event


How can I do this?
thanks
Posted
Comments
Vedat Ozan Oner 1-Apr-14 7:32am    
if you don't have to use .net remoting, wcf is advised by msdn. see http://msdn.microsoft.com/en-us/library/kwdt6w2k%28v=vs.85%29.aspx
[no name] 1-Apr-14 7:35am    
thanks to your comment, but I want to use the .net remoting

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