How to dispose a .NET Remoting Host Server (Server ActiVated Objects)

xiaoxiao2021-03-06  19

1, First and foremost you will Refer Your OWN Assembly Then Define a class deact from "MarshalByrefObject"!

2, the you shop Register ITS Ports: http or tcp like this:

HTTPCHANNEL CNL = New httpchannel (7608);

ChannelServices.RegisterChannel (CNL);

oral

Tcpchannel CNL = New TcpChannel (7711);

ChannelServices.RegisterChannel (CNL);

3. Define a applicationname --- Be equal to IIS Application, Like this:

RemotingConfiguration.ApplicationName = "TransrremotingService"

4, Define a Well Known Service Type Entry

WellknownServiceTypeEntry Etr = New (WellkNownServiceTypeEntry ("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!

转载请注明原文地址:https://www.9cbs.com/read-39981.html

New Post(0)