[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

PRB: Remoting and COM-Interop

news

7/29/2004 12:13:00 PM

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
Darius
1 Answer

Sunny

7/29/2004 2:01:00 PM

0

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