all groups > dotnet remoting > july 2003 >
You're in the

dotnet remoting

group:

Is it possible to host several remote objects using one host?



Is it possible to host several remote objects using one host? Konstantin Vyaznikov
7/23/2003 2:51:46 PM
dotnet remoting: Hi,

I cannot find information of how to host several remote objects (assemblies)
by one host application
(let's say by Windows service)?

Is it possible at all? Or I should have separate host application for every
object?

Thanks,
Konstantin Vyaznikov.

Re: Is it possible to host several remote objects using one host? Rob Teixeira [MVP]
7/23/2003 7:55:45 PM
It is possible. Load the assemblies into the host process (Assembly.Load)
and make sure you set all the remotable types in the remoting section of the
config file or programatically register the remotable objects (your choice).
Each entry consists of the full assembly name and type name, so you can span
assemblies if you like.

-Rob [MVP]

[quoted text, click to view]

Re: Is it possible to host several remote objects using one host? soni_ace NO[at]SPAM hotmail.com
7/23/2003 10:15:21 PM
hi Rob,
a quick question here ...
say i have 2 remotable objects ..
in the server process .. do i have to register different ports using
IDictionary(assuming i'm using the TCP channel.) or can i use the same
port ..
ex:
//== register a channel ===
TcpServerChannel channel = new TcpServerChannel(1234);
ChannelServices.RegisterChannel(channel);

RemotingConfiguration.RegisterWellKnownServiceType(typeof("SomeType"),"Remotableobject",System.Runtime.Remoting.WellKnownObjectMode.SingleCall);

//== register a channel ===
TcpServerChannel channel1 = new TcpServerChannel(1235);
ChannelServices.RegisterChannel(channel1);

RemotingConfiguration.RegisterWellKnownServiceType(typeof("SomeType1"),"Remotableobject1",System.Runtime.Remoting.WellKnownObjectMode.SingleCall);

Next to access these objects is it possible to do so from a single
client ..?

Re: Is it possible to host several remote objects using one host? Rob Teixeira [MVP]
7/24/2003 1:33:24 AM
1) The channel is registered to a port, but you can have as many object
types from as many assemblies as you want attached to that channel.

2) Clients only care about what URL (including port) an instance of a
particular type can be reached at. Clients can access as many object types
as the server exposes. It gets a little trickier when the communication is
two way (events from server to client), but the same principle applies.

-Rob [MVP]

[quoted text, click to view]
RemotingConfiguration.RegisterWellKnownServiceType(typeof("SomeType"),"Remot
ableobject",System.Runtime.Remoting.WellKnownObjectMode.SingleCall);
[quoted text, click to view]
RemotingConfiguration.RegisterWellKnownServiceType(typeof("SomeType1"),"Remo
tableobject1",System.Runtime.Remoting.WellKnownObjectMode.SingleCall);
[quoted text, click to view]

AddThis Social Bookmark Button