Ansel's Blog

It would probably render the application more complex

博客园 首页 新随笔 联系 订阅 管理

1、First and foremost you should refer your own Assembly then define a Class derived from "MarshalByRefObject" !

2、Then you should register its  ports : Http or Tcp as following:

    HttpChannel cnl=new HttpChannel(7608);

    ChannelServices.RegisterChannel(cnl);

    or

     TcpChannel cnl=new TcpChannel(7711);

     ChannelServices.RegisterChannel(cnl);

3、define a ApplicationName---be equal to IIS application,like this: 

      RemotingConfiguration.ApplicationName="TranserRemotingService"

4、define a  Well Known Service Type Entry

     WellKnownServiceTypeEntry ETR=new(WellKnownServiceTypeEntry (typeof("your class"),"OBJURL",WellKnownObjectMode.SingleCall  or WellKnownObjectMode.Singleton ));

5、Register this Entry

RemotingConfiguration.RegisterWellKnownServiceType(ETR);

 Ok,now you can establish your client to test your Host Server!

posted on 2005-04-05 15:14  Ansel  阅读(898)  评论(1)    收藏  举报