您的位置:首页 > 其它

remoting

2004-12-06 14:34 288 查看
Here are the steps to build the server:

Add a reference to the System.Runtime.Remoting.dll assembly.

Implement a class that derives from MarshalByRefObject.

Choose one of the provided channel implementations (TCP or HTTP), and register it using the ChannelServices.RegisterChannel method.

Register the class as a well-known object using the RemotingConfiguration.RegisterWellKnownServiceType method. Keep the server alive waiting for client requests the steps for creating the client are as follows:

Add a reference to the System.Remoting.Runtime.Remoting.dll.

Add a reference to the assembly containing the metadata for the remote type, in this case MathLibrary.dll.

Register a channel object using the same channel type as the server.

Call the Activator.GetObject method, passing the appropriate URL, to retrieve a proxy to the remote object.

Cast the proxy to the correct type and start using it as if it were the actual object.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: