HighTechTalks DotNet Forums  

Unregistered custom channel still being used

Dotnet Framework (Remoting) microsoft.public.dotnet.framework.remoting


Discuss Unregistered custom channel still being used in the Dotnet Framework (Remoting) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Gary H
 
Posts: n/a

Default Unregistered custom channel still being used - 10-11-2006 , 03:35 PM






I created a custom client formatter sink to pass some information. I can
create it as follows:

BinaryClientFormatterSinkProvider binarySink = new
BinaryClientFormatterSinkProvider();
ClientSecuritySinkProvider secureSink = new
ClientSecuritySinkProvider(username, password);
secureSink.Next = binarySink;
_tcpChannel = new TcpClientChannel("tcp", secureSink);

ChannelServices.RegisterChannel(_tcpChannel);

This works the first time. However, if I call:
ChannelServices.RegisterChannel(_tcpChannel);

and then reexecute the code with a different username and password, the
first channel is still being used although I unregistered it! I verified
that the new channel is being created with a new username and password. So,
for some reason, the first created channel continues to be used.

What could I be doing wrong? The only way I can stop using the original
channel is to restart my application.

Thanks,
Gary H

Reply With Quote
  #2  
Old   
Gary H
 
Posts: n/a

Default RE: Unregistered custom channel still being used - 10-12-2006 , 08:36 AM






Also, to be clear. I am performing:
Activator.GetObject(...) after the RegisterChannel call. And, I am
performing a ChannelServices.UnregisterChannel(_tcpChannel) before
registering the channel again.

I did further searching on Google and found another person reported this
probably way back in .NET 1.0 but there was no response to him. I am
currently using .NET 2.0.

Quote:
I created a custom client formatter sink to pass some information. I can
create it as follows:

BinaryClientFormatterSinkProvider binarySink = new
BinaryClientFormatterSinkProvider();
ClientSecuritySinkProvider secureSink = new
ClientSecuritySinkProvider(username, password);
secureSink.Next = binarySink;
_tcpChannel = new TcpClientChannel("tcp", secureSink);

ChannelServices.RegisterChannel(_tcpChannel);

This works the first time. However, if I call:
ChannelServices.RegisterChannel(_tcpChannel);

and then reexecute the code with a different username and password, the
first channel is still being used although I unregistered it! I verified
that the new channel is being created with a new username and password. So,
for some reason, the first created channel continues to be used.

What could I be doing wrong? The only way I can stop using the original
channel is to restart my application.

Thanks,
Gary H

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.