HighTechTalks DotNet Forums  

TCPChannel ignoring formatter!

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


Discuss TCPChannel ignoring formatter! in the Dotnet Framework (Remoting) forum.



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

Default TCPChannel ignoring formatter! - 04-25-2007 , 04:22 AM






Hi,

I have a client and server that uses remoting to test the differences
between the different combinations of channels and formatters (well, at least
it attempts to).

Here's the problem. The server is setup for TCP:8081 with a binary
formatter. The client can switch between binary and soap. I do this by
unregistering the channel and the re-registering it with the correct
formatter. What happens though is that the runtime completely ignores my
unregister/re-register action.

If I invoke the object for the first time using soap it causes an exception
as expected. If I switch to binary though (unregister the channel with a soap
formatter and register a new channel with a binary formatter), it still fails
with the same exception! The other ways around is also true, ie using binary
first will succeed, but then using soap subsequently also succeeds!!

Obviously the unregister does not kill the channel, and registering a new
one does not replace the first one register (even though checking
ChannelServices.RegisteredChannels show the old channel being removed and the
new one being registered). I have to restart the client to clear whatever is
being "cached".

What is going on here? How can I force my client to kill all
channels/proxies/whatever else so I can switch to a different formatter at
runtime?

Thanks for you help.
Tallies

Reply With Quote
  #2  
Old   
Tallies
 
Posts: n/a

Default RE: TCPChannel ignoring formatter! - 04-25-2007 , 04:30 AM






Ok, just realised that you don't have to register channels on the client!
Duh. But, if so, how can I tell the client to use a specific format at
runtime (assuming my server listens for both), i.e. binary or soap?

Thanks
Tallies

"Tallies" wrote:

Quote:
Hi,

I have a client and server that uses remoting to test the differences
between the different combinations of channels and formatters (well, at least
it attempts to).

Here's the problem. The server is setup for TCP:8081 with a binary
formatter. The client can switch between binary and soap. I do this by
unregistering the channel and the re-registering it with the correct
formatter. What happens though is that the runtime completely ignores my
unregister/re-register action.

If I invoke the object for the first time using soap it causes an exception
as expected. If I switch to binary though (unregister the channel with a soap
formatter and register a new channel with a binary formatter), it still fails
with the same exception! The other ways around is also true, ie using binary
first will succeed, but then using soap subsequently also succeeds!!

Obviously the unregister does not kill the channel, and registering a new
one does not replace the first one register (even though checking
ChannelServices.RegisteredChannels show the old channel being removed and the
new one being registered). I have to restart the client to clear whatever is
being "cached".

What is going on here? How can I force my client to kill all
channels/proxies/whatever else so I can switch to a different formatter at
runtime?

Thanks for you help.
Tallies

Reply With Quote
  #3  
Old   
Tallies
 
Posts: n/a

Default RE: TCPChannel ignoring formatter! - 04-25-2007 , 05:28 AM



OK, here what I've been able to glean thus far.

What happens is that if I register a TcpClientChannel with a SOAP formatter
the first, then the browsing into the proxy object hierarchy, you will
eventually find a member called IdentityObject, which contains a member
called SinkChannel, which is accordingly set to SoapClientFormatterSink.

The second time round (unregistered all channels) with a tcp channel and
BinaryFormatter, when I create the object (and thus the proxy), browsing into
the object will now STILL have the SinkChannel as a SoapClientFormatterSink!

Where does the proxy instantiation get this information from?! Surely (and
that's what I thought up to now) it would be from the currently registered
channel! Alas, no, it somehow remembers the first one I used.

BTW, I forgot to mention in the first post that I use a WellKnown object,
there for SAO.

Can anybody give some help in understanding this?

Thanks
Tallies

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.