Groups | Blog | Home
all groups > dotnet remoting > january 2005 >

dotnet remoting : Why don't you declare the port no. in a remoting client using Chan


Fredric Ragnar
1/31/2005 1:43:03 AM
Hello,

I am making a system utilizing remoting with a TcpChannel between the server
and the client. I want to know all the details concerning the networking part
to prevent any future problems with firewalls or networking issues at the
deploying site.

Setup:

Server - hosting remote object: port
8080
|
|TcpChannel
|
Client:8085

In the client there is only one call to the server object. It returns the
system time. However, when I try to set the port in the client I get the
following exceptions:
Message
Only one usage of each socket address (protocol/network address/port) is
normally permitted

Source
System.Runtime.Remoting

Stacktrace at
System.Runtime.Remoting.Channels.Tcp.TcpServerChannel.StartListening(Object
data)
at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel.SetupChannel()
at
System.Runtime.Remoting.Channels.Tcp.TcpServerChannel..ctor(IDictionary
properties, IServerChannelSinkProvider sinkProvider)
at System.Runtime.Remoting.Channels.Tcp.TcpChannel..ctor(IDictionary
properties, IClientChannelSinkProvider clientSinkProvider,
IServerChannelSinkProvider serverSinkProvider)
at MyNewServiceClient.Form1..ctor() in c:\documents and settings\frra\my
documents\visual studio projects\mynewserviceclient\form1.cs:line 49


When browsing the course literature for Microsoft Official Course 2349B
Programming with the Microsoft .NET Framework (Microsoft Visual C# .NET) I
found in the remoting module concerning registration of the channel in the
client: "Important You do not specify a port number when you register the
client channel".

The question is why is that?


Regards,
Fredric Ragnar
Fredric Ragnar
1/31/2005 6:45:02 AM
Hi Dumitru,

I thought as much. The reason for such a thing is total control to
anticipate any possible trouble with environments with very restrictive
networking policies.

Thank you for pointing out the obvious!


Regards,
Fredric Ragnar

[quoted text, click to view]
Dumitru Sbenghe
1/31/2005 12:55:03 PM
What will be the usefulness of declaring a fixed port for client?! Beside
the fact that this will restrict you to open only one connection from the
client to the server?! :) This will limit your application serious. Can you
imagine Internet Explorer with the posibility of opening only one http
connection, because it will have only one client port disponible per http
server (or worse per application)?!

It is a logical restriction; not a physical one or from the tcp/ip protocol
stack or from the socket api.

Dumitru Sbenghe


[quoted text, click to view]

vbMental
3/1/2005 1:43:03 PM
I have the same problem. I am looking into a socket option called SO_REUSEADDR
that will supposedly let you reuse the same address, and yes smart-alics on
here all want to reply just to post the obvious "why would you want to do
that?".
I can definitely understand why you would - for instance in my scenario, the
network is tightly secured and the firewall administrators only opens the
minimum ports required for communication so I need to pinpoint those ports.

Is that a good enough reason Dmitru??????
(idiot)

[quoted text, click to view]
vbMental
3/1/2005 1:43:06 PM
I have the same problem. I am looking into a socket option called SO_REUSEADDR
that will supposedly let you reuse the same address, and yes smart-alics on
here all want to reply just to post the obvious "why would you want to do
that?".
I can definitely understand why you would - for instance in my scenario, the
network is tightly secured and the firewall administrators only opens the
minimum ports required for communication so I need to pinpoint those ports.

Is that a good enough reason Dmitru??????
(idiot)

[quoted text, click to view]
AddThis Social Bookmark Button