Hi,

I've discovered a strange behaviour with a .NET Remoting HTTP Channel
(Windows Service EXE)  along side with IIS 6.0 (Windows .NET , same problem
with IIS 5.0/5.1)

I run two IP's on the NIC:

- 192.168.10.3:80 for IIS Website
- 192.168.10.4:80 for .NET Remoting HTTP Channel.

The problem is, that both the IIS & .NET Remoting HTTP Channel  claim to use
Port 80 on *all* available IP's . But both are configured to use a specific
IP address. Using different Ports will slove the problem, but I need to run
IIS & the HTTP Channel on Port 80 for real-world reasons, but can provide
different IP-Adresses for both Services.

Running the IIS Website first will prevent the .NET Remoting HTTP Channel to
start:

---
Service cannot be started. System.Net.Sockets.SocketException: Only one
usage of each socket address (protocol/network address/port) is normally
permitted
   at
System.Runtime.Remoting.Channels.Http.HttpServerChannel.StartListening(Objec
t data)
   at System.Runtime.Remoting.Channels.Http.HttpServerChannel.SetupChannel()
   at
System.Runtime.Remoting.Channels.Http.HttpServerChannel..ctor(IDictionary
properties, IServerChannelSinkProvider sinkProvider)
[...]
---

Running the .NET Remoting HTTP Channel first, will prevent the IIS Website
to run:

---
Cannot claim the URL prefix 'http://192.168.10.3:80/' for site '355052516'.
The necessary network binding may already be in use. The site will be
deactivated. [...]
---

That's how I register the HTTP Channel (and a TCP Channel which works fine):

---
protected override void OnStart(string[] args)
  {
   Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.High;

   IDictionary http_props = new Hashtable();
   http_props["port"] = 80;
   http_props["bindTo"] = "192.168.10.4";
   HttpServerChannel http_channel = new HttpServerChannel(http_props, new
BinaryServerFormatterSinkProvider());
   ChannelServices.RegisterChannel(http_channel);

   IDictionary tcp_props = new Hashtable();
   tcp_props["port"] = 9932;
   tcp_props["bindTo"] = "192.168.10.4";
   TcpServerChannel tcp_channel = new TcpServerChannel(tcp_props, new
BinaryServerFormatterSinkProvider());
   ChannelServices.RegisterChannel(tcp_channel);


RemotingConfiguration.RegisterWellKnownServiceType(typeof(ServiceClass),"Ser
viceClass", WellKnownObjectMode.SingleCall);
---

I've searched the Newsgroup-Archive about this problem, but didn't found a
way to slove this issue.
The Ports are not blocked, because I can start, use & stop the IIS or the
HTTP Channel so often I want, but not both at the same time...

Is it possible to fix the IIS and the .NET Remoting HTTP Channel to a
specific IP on the Operating System-Level ? Somehow both services don't care
about the IP I address to them.


André

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to