Re: NAT and Remoting
- From: Allen Anderson <allen@xxxxxxxxxxxxxxxxx>
- Date: Wed, 31 Aug 2005 13:12:35 -0600
no it's a problem with SAO and CAO. The solution I came up with was only applicable for CAO's but I'm told by many who implemented a solution based off my original article that they were able to make it work with SAO's as well.
-Allen
http://www.glacialcomponents.com
http://allenanderson.blogspot.com
On Wed, 31 Aug 2005 13:48:25 -0500, "Ice" <ice@xxxxxxxxxx> wrote:
>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
>>
>
.
- Follow-Ups:
- Re: NAT and Remoting
- From: Ice
- Re: NAT and Remoting
- References:
- Re: NAT and Remoting
- From: Ice
- Re: NAT and Remoting
- Prev by Date: Re: Registering two channels
- Next by Date: Re: Registering two channels
- Previous by thread: Re: NAT and Remoting
- Next by thread: Re: NAT and Remoting
- Index(es):
Relevant Pages
|