Re: NAT and Remoting

Tech-Archive recommends: Fix windows errors by optimizing your registry



is this only a problem with CAO?

ice
"Allen Anderson" <allen@xxxxxxxxxxxxxxxxx> wrote in message
news:78rpg1dgr8e3m7ipif6lnlvrdhvtshei3s@xxxxxxxxxx
> that original post was by me a long time ago before I learned more on this
subject. I wrote an article about the solution I came to here
>
> http://www.glacialcomponents.com/ArticleDetail.aspx?articleID=CAOMN
>
> not sure if that will solve all your problems but that's how I did it.
>
> -Allen
>
>
> On 21 Aug 2005 11:36:14 -0700, "venkats_n" <venkats_n@xxxxxxxxxxx> wrote:
>
> >I am developing an WinForms based application used 90% within a LAN and
> >10% across the Internet though the Internet use may increase over time.
> >This application uses the remoting technology.
> >
> >The application does not work for Natted IP addresses.
> >
> >I tried to work around this problem with the reference of the post "nat
> >routing, firewalls and remoting" in the same forum.
> >
> >I have reached someplace, but I am now struggling to proceed further.
> >The steps I followed :
> >
> >1. Created a Server Side Sink and registered it through the web.config
> >as I am using IIS as host for my remote object
> ><system.runtime.remoting>
> > <application>
> > <channels>
> > <channel ref="http">
> > <serverProviders>
> > <provider type="SinkAssembly.ServerSinkProvider, SinkAssembly"/>
> > <formatter ref="soap" typeFilterLevel="Full" />
> > </serverProviders>
> > </channel>
> > </channels>
> >....
> >
> >2. The sink looks somewhat like this :
> >public class ServerSink : BaseChannelSinkWithProperties,
> >IServerChannelSink
> > {
> >
> > private IServerChannelSink _nextSink;
> >
> > public ServerSink(IServerChannelSink next)
> > {
> > _nextSink = next;
> > }
> >
> >
> > public IServerChannelSink NextChannelSink
> > {
> > get
> > {
> > return _nextSink;
> > }
> > }
> >....
> >....
> >public ServerProcessing ProcessMessage(IServerChannelSinkStack
> > sinkStack,
> > IMessage requestMsg,
> > ITransportHeaders requestHeaders,
> > Stream requestStream,
> > out IMessage responseMsg,
> > out ITransportHeaders responseHeaders,
> > out Stream responseStream)
> > {
> > IPAddress ipAddress =
> > requestHeaders[CommonTransportKeys.IPAddress] as IPAddress;
> >
> > CallContext.SetData("ClientIP",ipAddress);
> >
> > ServerProcessing srvProc = _nextSink.ProcessMessage(sinkStack,
> > requestMsg,
> > requestHeaders,
> > requestStream,
> > out responseMsg,
> > out responseHeaders,
> > out responseStream);
> >
> >
> > return ServerProcessing.Complete;
> > }
> >
> >3. Created a Tracking Handler class.
> >public class TrackingHandler : ITrackingHandler
> > {
> > public void MarshaledObject(Object obj, ObjRef or)
> > {
> >...................
> >...................
> >IPAddress ipAddress = (IPAddress )CallContext.GetData("ClientIP");
> >
> > object[] MyChannelData = new object[or.ChannelInfo.ChannelData.Length
> >];
> >
> >
> >for ( int i = or.ChannelInfo.ChannelData.GetLowerBound(0); i <=
> >or.ChannelInfo.ChannelData.GetUpperBound(0); i++ )
> > {
> > if(or.ChannelInfo.ChannelData[i] is ChannelDataStore)
> > {
> > //then manipulate the ChannelUris
> >
> > }
> > }
> >.........................
> >
> >4. Derieved all my Remote Object classes from a Base Class which looks
> >like this :
> >
> >public abstract class RemotingBase : MarshalByRefObject
> > {
> >
> >private static bool bProbingStarted = false;
> >private TrackingHandler trkHndlr = null;
> >.................
> >........
> >...
> >..
> >.
> >public RemotingBase()
> > {
> > StartProbing ();
> > }
> >
> > ~RemotingBase()
> > {
> > StopProbing();
> > }
> >
> >
> > #region Methods for Tracking Handler
> >
> > private void StartProbing ()
> > {
> > if (bProbingStarted != true)
> > {
> > StartRemoteServerTrackingHandler ();
> > bProbingStarted = true;
> > }
> > }
> >
> >
> > private void StopProbing ()
> > {
> > if (bProbingStarted == true)
> > {
> > StopRemoteServerTrackingHandler ();
> > bProbingStarted = false;
> > }
> > }
> >
> >
> > private void StartRemoteServerTrackingHandler ()
> > {
> > trkHndlr = new TrackingHandler();
> > TrackingServices.RegisterTrackingHandler (trkHndlr);
> > }
> >
> >
> > private void StopRemoteServerTrackingHandler()
> > {
> > if (null != trkHndlr)
> > {
> > TrackingServices.UnregisterTrackingHandler (trkHndlr);
> > }
> > }
> >...............
> > }
> >
> >Thanks and Regards,
> >Venkat
>


.



Relevant Pages

  • NAT and Remoting
    ... IMessage requestMsg, ... out IMessage responseMsg, ... private void StartProbing ... trkHndlr = new TrackingHandler; ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: NAT and Remoting
    ... > IMessage requestMsg, ... > out IMessage responseMsg, ... > private void StartProbing ... > trkHndlr = new TrackingHandler; ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: NAT and Remoting
    ... > IMessage requestMsg, ... > out IMessage responseMsg, ... > private void StartProbing ... > trkHndlr = new TrackingHandler; ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: NAT and Remoting
    ... no it's a problem with SAO and CAO. ... >>> IMessage requestMsg, ... >>> out IMessage responseMsg, ... >>> private void StartProbing ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: MSDN .Net Remoting Sample ?
    ... I am trying to build and run the Remoting Sample from MSDN. ... sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, ... Stream requestStream, IMessage& responseMsg, ITransportHeaders& ...
    (microsoft.public.dotnet.languages.vb)