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
[quoted text, click to view] "Tallies" wrote:
> 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.
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