By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,846 Members | 2,082 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,846 IT Pros & Developers. It's quick & easy.

.NET Remoting with Multiple Channels

P: n/a
If you've configured .NET Remoting to use more than one channel of the
same type, for example two TcpClientChannels with unique names, when
you want to create a proxy to a remote object how do you specify which
channel you want that proxy to use?

Thanks in advance.

Jul 17 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi Breet,
how do you specify which
channel you want that proxy to use
You don't. The framework will choose the local channel to use as a
transport when invoking a message on a remote object. The framework will
create a channel for outbound messages if one is not already registered when
a method on the remote object is invoked. If you require call-backs from
the remote object then you must register a channel yourself that is
compatible with the target channel on the server.

Registering multiple channels of the same type on the client, named or
unnamed, is unnecessary in most cases, however if you have multiple proxies
in the same application that each require different channel sinks then you
can separate the proxies into different AppDomains, within the same process,
since the scope of a channel is the AppDomain in which it was registered.

- Dave Sexton

<br****@yahoo.comwrote in message
news:11**********************@35g2000cwc.googlegro ups.com...
If you've configured .NET Remoting to use more than one channel of the
same type, for example two TcpClientChannels with unique names, when
you want to create a proxy to a remote object how do you specify which
channel you want that proxy to use?

Thanks in advance.

Jul 18 '06 #2

P: n/a
Thank you for the reply, but I have to wonder why the remoting
framework would allow us to register multiple channels, especially
channels of the same type, if it won't allow us to select which channel
to use for a given remote object.

For example, say you have a single application that communicates with
two different servers (remote objects), one server uses a secure TCP
channel and the other a non-secure TCP channel. When you create the
remote object references in the client how is the determination made
whether to use the secure or non-secure channel?

Dave Sexton wrote:
Hi Breet,
how do you specify which
channel you want that proxy to use

You don't. The framework will choose the local channel to use as a
transport when invoking a message on a remote object. The framework will
create a channel for outbound messages if one is not already registered when
a method on the remote object is invoked. If you require call-backs from
the remote object then you must register a channel yourself that is
compatible with the target channel on the server.

Registering multiple channels of the same type on the client, named or
unnamed, is unnecessary in most cases, however if you have multiple proxies
in the same application that each require different channel sinks then you
can separate the proxies into different AppDomains, within the same process,
since the scope of a channel is the AppDomain in which it was registered.

- Dave Sexton

<br****@yahoo.comwrote in message
news:11**********************@35g2000cwc.googlegro ups.com...
If you've configured .NET Remoting to use more than one channel of the
same type, for example two TcpClientChannels with unique names, when
you want to create a proxy to a remote object how do you specify which
channel you want that proxy to use?

Thanks in advance.
Jul 18 '06 #3

P: n/a
Hi Breeto,
For example, say you have a single application that communicates with
two different servers (remote objects), one server uses a secure TCP
channel and the other a non-secure TCP channel. When you create the
remote object references in the client how is the determination made
whether to use the secure or non-secure channel?
The port segment of the Uri would be different between the registration of
both objects. If you want to publish several remote objects using multiple
ports you can do so in remoting. Of course each object is then accessible
by any registered channel and therefore any of the registered protocol/port
combinations.

Server-side registration:

Register HttpChannel:81
Register TcpChannel:8080
Register TcpChannel:8081 (Secured)

Register remote object: object1
Register remote object: object2

Valid URIs:

http:// localhost:81/object1
http:// localhost:81/object2
tcp://localhost:8080/object2
tcp://localhost:8081/object1
tcp://localhost:8080/object1
tcp://localhost:8081/object2

The remoting framework will choose an appropriate client channel or create
one if one has not been registered. For secure channels you would have to
register the client channel yourself to specify the security parameters and
credentials, unless the framework just creates a channel with the default
credentials but I doubt that since it would not be very secure for the
framework to assume the default credentials may be sent without explicit
consent from the application.

Use multiple AppDomains on the server if you require that a published object
only be accessible via specific channel sinks or remoting channels
(protocol/port combinations).
Use multiple AppDomains on the client if you require proxies to use specific
channel sinks or remoting channels (protocol/local port combinations).

- Dave Sexton

<br****@yahoo.comwrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
Thank you for the reply, but I have to wonder why the remoting
framework would allow us to register multiple channels, especially
channels of the same type, if it won't allow us to select which channel
to use for a given remote object.

For example, say you have a single application that communicates with
two different servers (remote objects), one server uses a secure TCP
channel and the other a non-secure TCP channel. When you create the
remote object references in the client how is the determination made
whether to use the secure or non-secure channel?

Dave Sexton wrote:
>Hi Breet,
how do you specify which
channel you want that proxy to use

You don't. The framework will choose the local channel to use as a
transport when invoking a message on a remote object. The framework will
create a channel for outbound messages if one is not already registered
when
a method on the remote object is invoked. If you require call-backs from
the remote object then you must register a channel yourself that is
compatible with the target channel on the server.

Registering multiple channels of the same type on the client, named or
unnamed, is unnecessary in most cases, however if you have multiple
proxies
in the same application that each require different channel sinks then
you
can separate the proxies into different AppDomains, within the same
process,
since the scope of a channel is the AppDomain in which it was registered.

- Dave Sexton

<br****@yahoo.comwrote in message
news:11**********************@35g2000cwc.googlegr oups.com...
If you've configured .NET Remoting to use more than one channel of the
same type, for example two TcpClientChannels with unique names, when
you want to create a proxy to a remote object how do you specify which
channel you want that proxy to use?

Thanks in advance.

Jul 18 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.