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

dotnet remoting

group:

PRB: Remoting and COM-Interop


PRB: Remoting and COM-Interop news NO[at]SPAM esna-ashari.de
7/29/2004 5:13:27 AM
dotnet remoting: The problem:
I developed a remoting server and a corresponding client dll. I used a
dll as the remoting client because I want to prevent my applications
from knowing remoting details.
So applications call functions in the remoting client dll. This dll
talks to the remoting server via tcp and returns the information to
the application. With all the hints from Mr. Rammer's articles and
books ;-) everything works fine when using a .NET-application as the
calling application. But when using a very simple VB6-application the
thing only works once! I've got a Button on a form and the code behind
says something like this

Dim x As StrukturdatenClient
Set x = New StrukturdatenClient

Dim y As SomeObject
Set y = x.ReadSomeObject()

MsgBox "done"

Set x = Nothing


When pressing the button again I end up with an exception:
The channel 'tcp' is already registered...
I have to exit the VB6-application and start it over to be able to use
the remoting client again.

Here is my remoting configuration for the client:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application>
<channels>
<channel ref="tcp" port="0">
<clientProviders>
<formatter ref="binary" />
</clientProviders>
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full" />
</serverProviders>
</channel>
</channels>

<client>
<wellknown type="Strukturdatenserver.interfaces.IStrukturdatenserver,
Strukturdatenserver.interfaces"
url="tcp://localhost:8081/Strukturdatenserver.soap" />
</client>

</application>
</system.runtime.remoting>

</configuration>

So I'm not quite sure how VB6 handles my remoting client and why the
exception occurs. Help is highly appreciated!

Thanks
Re: PRB: Remoting and COM-Interop Sunny
7/29/2004 9:01:27 AM
Most probably you are trying to register the channel every time you
invoke the object. You may put the channel registration code in a static
constructor of your class, that way it will invoked only once.

Sunny

In article <23f812ee.0407290413.6fb9a068@posting.google.com>, news@esna-
ashari.de says...
[quoted text, click to view]
AddThis Social Bookmark Button