.NETGURU
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




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification