How to expose two different objects from single server via .NET Remoting?
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.remoting.

Post a new message to this list...

oren
How to expose two different objects via .NET Remoting?

Hello,

I am trying to do the following:
Exposing Obj1 and Obj2 via ProcessA
Conects to obj1 from Client1 and connect Obj2 from Client2
both Objects has events.

Obj1 is implemented in ProcessA
Obj2 is implemented in DLL.
The DLL is referencedin ProcessA

When I expose only one object the server starts well and the
corresponded client work with it great.

When I try to expose them both
The first Configure call , of obj2, succeeded:
RemotingConfiguration.Configure("LogManagerRemoting.config");

I receive the following exception in the second Configure call:
RemotingConfiguration.Configure ("nvAppServer.exe.config");

Ex:
{"Remoting configuration failed with the exception
System.Runtime.Remoting.RemotingException: The remoting application
name, ServerAssembly, had already been set.\r\n at
System.Runtime.Remoting.RemotingConfigHandler.set_ApplicationName(String
value)\r\n at System.Runtime.Remoting.RemotingConfigHandler.ConfigureRemoting(RemotingXmlConfigFileData
configData)." }

My configuration
Obj2
config file:
     <system.runtime.remoting>
    <application name="ServerAssembly" >
<customErrors mode="off"/>
<service>

<wellknown mode="Singleton"
type="NiceVision.Common.LogManager.LogManagerEventSharedObj,
LogManager" objectUri="LogManagerUID" />
</service>
         <channels>
            <channel ref="tcp" port="64545">    
            <serverProviders>            
                    <formatter ref="binary" typeFilterLevel="Full" />
                </serverProviders>                
            
                
            </channel>    
         </channels>        

<lifetime leaseTime="3D" sponsorshipTimeout="1H"
renewOnCallTime="1D" leaseManagerPollTime="1H" />
</application>
</system.runtime.remoting>

obj1
Config file
<system.runtime.remoting>
    <application name="nvAppServer" >
<customErrors mode="off"/>
<service>

<wellknown mode="Singleton"
type="NiceVision.ApplicationServer.ServiceInterfaces.ApplicationServerAPI,
nvAppServer" objectUri="ApplicationServer" />
</service>
         <channels>
            <channel ref="tcp" port="65100">    
            <serverProviders>            
                    <formatter ref="binary" typeFilterLevel="Full" />
                </serverProviders>    
            </channel>    
         </channels>

<lifetime leaseTime="3D" sponsorshipTimeout="1H"
renewOnCallTime="1D" leaseManagerPollTime="1H" />
</application>
</system.runtime.remoting>
Reply to this message...
 
    
Ken Kolda
What you're trying to do won't work without creating a second AppDomain.In a
single AppDomain, every remoted object is exposed through every remoting
channel registered in that domain. Thus, if you create two TCP channels on
two different ports, you cannot specify that Object A should be attached to
Port #1 and Object B attached to Port #2.

So, you should either merge your config files into a single file or create
two AppDomains and have each read its own config file separately.

Ken

"oren" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

onfigFileData
[Original message clipped]

Reply to this message...
 
 
System.AppDomain
System.Runtime.Remoting.RemotingConfiguration
System.Runtime.Remoting.RemotingException




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com