all groups > dotnet remoting > july 2005 >
You're in the

dotnet remoting

group:

registering 2 channels for each of 2 networkcards


registering 2 channels for each of 2 networkcards David
7/29/2005 12:00:00 AM
dotnet remoting:
hello!

I have a server which has 2 buildin network cards. I must be able to access
a singleton service from both networks represented by the 2 networkcards.
the 2 networks should remain separated because of security reasons.( I know
that now my service is propably the security problem)
So I created 2 HttpChannels and bound them to each one to the corresponding
network adapter adresses.

//first channel
System.Collections.IDictionary props = new System.Collections.Hashtable();
props["port"] = "81";
props["name"] = "http81";
props["bindTo"] = 111.111.111.2;
HttpChannel clientHttpChannel1 = new HttpChannel(props, clientProvider,
serverProvider);
ChannelServices.RegisterChannel(clientHttpChannel1);

//second channel
System.Collections.IDictionary props = new System.Collections.Hashtable();
props["port"] = "82";
props["name"] = "http82";
props["bindTo"] = 168.164.1.2;
HttpChannel clientHttpChannel2 = new HttpChannel(props, clientProvider,
serverProvider);
ChannelServices.RegisterChannel(clientHttpChannel2);

then I have a object which provides the service I register like
//register Service
Type theType = typeof(PathologyDataServer);
RemotingConfiguration.RegisterWellKnownServiceType(theType,
"PathologyDataServer", WellKnownObjectMode.Singleton );


everything works fine whilst connecting the first time to one of the
channels, but as soon as I try to connect to the other channel from another
computer I got a exception :
System.Net.WebException
{"The underlying connection was closed: Unable to connect to the remote
server." }
but this Exception does not affect the other channel, I am then still able
to use my service on the first connected machine.

Problem:
My aim is to use a singleton object service with 2 channels.

but I now wonder, if that is just not possible.


Any ideas, experiences, hints?
I appreciate everything!!

Thanks in advance

David

Re: registering 2 channels for each of 2 networkcards Roy Chastain
7/29/2005 1:27:59 PM
I would like to know what advantage you are attempting to achieve by having 2 separate channels.

[quoted text, click to view]

-------------------------------------------
Roy Chastain
KMSYS Worldwide, Inc.
Re: registering 2 channels for each of 2 networkcards KidO
8/1/2005 8:05:04 AM
David,

I don't have a solution, but I do have the same problem. A Singleton
Remoting Server that I want to have available from both NICs installed in the
PC.

I tried the multiple channel approach, but was unable to get this to work.
It also appeared that when I did not use the bindTo property, that the
channel would bind itself only to 1 of the NIC's (first 1).

Normally, It is not necessary for my remoted server to be available to both
network cards, but it is convenient 2 use both cards when debugging at the
server in my particular installation.

My development environment is only equipped with 1 NIC, but I am planning to
do update the production environment in a week or so, at which time I hope to
try again to get this to work.

I will be watching this thread, so if you discover anything, please share...

Thank you,

--
- John


[quoted text, click to view]
Re: registering 2 channels for each of 2 networkcards Roy Chastain
8/1/2005 9:12:44 AM
I think if you omit the bindTo, it should bind to all interfaces/NICs on the system.

[quoted text, click to view]

-------------------------------------------
Roy Chastain
KMSYS Worldwide, Inc.
Re: registering 2 channels for each of 2 networkcards David
8/1/2005 9:34:44 AM
Hello!

By having two channels I can provide access to my service for the public
network #1.
And the second network which is not accessible from the public network can
also use the service at the same time.
I use two channels because I tried to bind one channel to both networkcards
IP's(property"bindTo"), but without success.
So I came up with the 2 channel idea...

Maybe someone can point out how to bind 2 IP's to a single channel!?

Thanks

David

AddThis Social Bookmark Button