Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Remoting / July 2003

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Konstantin Vyaznikov - 23 Jul 2003 19:51 GMT
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.
Rob Teixeira [MVP] - 24 Jul 2003 00:55 GMT
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]

> Hi,
>
[quoted text clipped - 7 lines]
> Thanks,
> Konstantin Vyaznikov.
Soni - 24 Jul 2003 06:15 GMT
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 ..?

Thanks ..
Rob Teixeira [MVP] - 24 Jul 2003 06:33 GMT
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]

> hi Rob,
> a quick question here ...
[quoted text clipped - 6 lines]
> TcpServerChannel channel = new TcpServerChannel(1234);
> ChannelServices.RegisterChannel(channel);

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

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

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

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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.