Re: Setting exclusiveAddressUse = false
From: Barry (Barry_at_discussions.microsoft.com)
Date: 08/27/04
- Previous message: Sam Santiago: "Re: Setting exclusiveAddressUse = false"
- In reply to: Sam Santiago: "Re: Setting exclusiveAddressUse = false"
- Next in thread: Sam Santiago: "Re: Setting exclusiveAddressUse = false"
- Reply: Sam Santiago: "Re: Setting exclusiveAddressUse = false"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 27 Aug 2004 12:17:05 -0700
We have encapsulated an older STA active x control inside a console
application so that it can be used by multiple server process at one time:
each active x process inside a separate STA app domain. These console
applications start and communicate pack to the client.
Everything works fine, however the client's initial communication was to a
server endpoint at port[nnnn]. These individual console applications
currently allow .NET to chose an open port for returning information to the
client, the return packes are from port[yyyy]. This is causing concern at
sites where restrictive firewalls are in place.
We need these individual app domains to communicate on the same port as the
primary server application, that is why the reuse.
As I read the Tcp/Http Channel docs and the Sockets docs it seems that
setting the channel property["exclusiveAddressUse"] = false should allow this
to be reused.
We need the indic=videaul
"Sam Santiago" wrote:
> Why do you think you need 2 channels with the same port? I do not think
> this is possible. This is a socket level restriction. You're probably
> getting this error:
>
> System.Net.Sockets.SocketException: Only one usage of each socket address
> (protocol/network address/port) is normally permitted
>
> Thanks,
>
> Sam
>
> --
> _______________________________
> Sam Santiago
> ssantiago@n0spam-SoftiTechture.com
> http://www.SoftiTechture.com
> _______________________________
> "Barry" <Barry@discussions.microsoft.com> wrote in message
> news:43BF1DC3-46BF-4B74-9E70-FCB54F9F0D22@microsoft.com...
> > Trying to understand why I cannot have two channels registered to the same
> > port. This is a test case for a business problem I am trying to solve.
> Any
> > help appreciated?
> >
> > using System;
> > using System.IO;
> > using System.Net;
> > using System.Collections;
> > using System.Diagnostics;
> > using System.Reflection;
> > using System.Runtime.Remoting;
> > using System.Runtime.Remoting.Channels;
> > using System.Runtime.Remoting.Channels.Tcp;
> > using System.Runtime.Remoting.Channels.Http;
> >
> > namespace ChannelTest
> > {
> > /// <summary>
> > /// Summary description for Class1.
> > /// </summary>
> > class Class1
> > {
> > /// <summary>
> > /// The main entry point for the application.
> > /// </summary>
> > [STAThread]
> > static void Main(string[] args)
> > {
> > //
> > // TODO: Add code to start application here
> > //
> > try
> > {
> > IChannel channel = MakeChannel(1240);
> > System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(channel);
> >
> > IChannel channel = MakeChannel(1240);
> > System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(channel);
> >
> > }
> > catch(Exception e)
> > {
> > Console.WriteLine(e.Message);
> > }
> > Console.ReadLine();
> > }
> >
> > public static TcpChannel MakeChannel(int port)
> > {
> > IDictionary props = new Hashtable();
> > // Specifies the port on which the channel will listen.
> > // If 0 is specified, then the remoting system will
> > // locate an open port for you.
> > props["port"] = port;
> > // Indicates the name of the channel. If this property is not set,
> > // the system defaults to the scheme name. If you want to register
> > // more than one ChannelProvider with the same scheme, each must
> > // have a unique name. String.Empty will allow any number of
> > // similar schemas without name collisions.
> > props["name"] = String.Empty;
> > props["exclusiveAddressUse"] = false;
> >
> > BinaryServerFormatterSinkProvider binaryProvider = new
> > BinaryServerFormatterSinkProvider();
> > binaryProvider.TypeFilterLevel =
> > System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;
> >
> > return new TcpChannel(props, null, binaryProvider);
> > }
> >
> > }
> > }
> >
> > --
> > Barry Lattie
>
>
>
- Previous message: Sam Santiago: "Re: Setting exclusiveAddressUse = false"
- In reply to: Sam Santiago: "Re: Setting exclusiveAddressUse = false"
- Next in thread: Sam Santiago: "Re: Setting exclusiveAddressUse = false"
- Reply: Sam Santiago: "Re: Setting exclusiveAddressUse = false"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|