.Net Remoting使用代理类. [英] .Net Remoting using proxy class.
本文介绍了.Net Remoting使用代理类.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经创建了一个远程对象类"OCL"来与黑白服务器和服务器进行通信.客户.
服务器端:
Hi,
I have created a Remote Object Class "OCL" to communicate b/w Server & Client.
Server Side :
HttpChannel myChannel = new HttpChannel(6300);
ChannelServices.RegisterChannel(myChannel);
RemotingConfiguration.RegisterWellKnownServiceType(typeof(OCL), "OCL", WellKnownObjectMode.Singleton);
客户端:
Client Side :
OCL object= (OCL)Activator.GetObject(typeof(OCL), "http://" + ServerIP + ":6300/OCL", WellKnownObjectMode.Singleton);
将数据从服务器发送到客户端可以正常工作.如何将数据从客户端发送到服务器?请帮助.谢谢.
It is working fine for sending data from Server to Client. How can i send data from Client to server? Plz Help. Thanks.
推荐答案
在远程对象上调用方法时,一切都类似于在本地对象上调用这些方法的方式.发送数据和接收数据仅与您是在调用返回数据的方法还是在调用具有参数的方法有关,您可以通过该方法将数据发送到对象.例如,返回字节数组的方法GetBytes
是接收数据的示例,而称为SetBytes(byte[] arg)
的等效方法显然是用于发送数据的方法.
When you are invoking methods on a remote object, everything''s analogous to how you''d be invoking those methods on a local object. Sending data and receiving data is just a matter of whether you are calling a method that returns data or whether you are calling a method that has parameters through which you can send data to an object. For example a methodGetBytes
which returns a byte array is an example of receiving data, whereas an equivalent method calledSetBytes(byte[] arg)
is fairly obviously a method for sending data.
这篇关于.Net Remoting使用代理类.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文