[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

.net remoting over internet

Gaetano Lazzo

6/29/2004 2:45:00 PM

Hi,
I'm a novice in remoting, and I've a problem trying to make it work over
internet.

I have a SAO (Singleton) named CampusDataAccessLoader. I want clients to
access this object in order to use it as a object-maker for another class
(CampusDataAccess). I don't need callback functions.
When I work in the LAN, it's all OK.
Well, the server code is the simply:

BinaryClientFormatterSinkProvider clientProvider = new
BinaryClientFormatterSinkProvider();
BinaryServerFormatterSinkProvider serverProvider = new
BinaryServerFormatterSinkProvider();
IDictionary props = new Hashtable();
props["port"] = 8989;
props["name"] = System.Guid.NewGuid().ToString();;
HttpChannel chan = new HttpChannel(props,clientProvider, serverProvider);
ChannelServices.RegisterChannel(chan);
RemotingConfiguration.RegisterWellKnownServiceType(
typeof(CampusDataAccessLoader), "CampusDataAccessLoader",
WellKnownObjectMode.Singleton);
While the client code is the simply:
BinaryClientFormatterSinkProvider clientProvider = new
BinaryClientFormatterSinkProvider();
BinaryServerFormatterSinkProvider serverProvider = new
BinaryServerFormatterSinkProvider();
IDictionary props = new Hashtable();
props["port"] = 8989;
props["name"] = System.Guid.NewGuid().ToString();
HttpChannel chan = new HttpChannel(props,clientProvider,serverProvider);
ChannelServices.RegisterChannel(chan);

Then the client gets the object with this instruction
DAL = (CampusDataAccessLoader)
Activator.GetObject(typeof(CampusDataAccessLoader),"Http://"+remserver+
":8989"+
"/CampusDataAccessLoader");
where remserver is the IP of the remote server

I'm using port 8989 because I've read it's firewall-friendly... but it seems
not !
I've a firewall on a server, and I've made a NAT on port 8989...
what I'm missing?
The error I'm getting is something like : System.Net.WebException:Underlying
connection closed. Impossible to connect to the remote server.
(The real message is in italian and is "Connessione sottostante chiusa:
Impossibile effettuare la connessione al server remoto").


But if i work on local network it works! So I suppose It's a firewall
problem...
Can some one help me?

Many thanks in advance!
Gaetano Lazzo


5 Answers

Sunny

6/29/2004 2:54:00 PM

0

Hi,
at server channel set use machine name property to be the external ip to
which client connects.

Sunny


In article <upEAZYeXEHA.3044@TK2MSFTNGP09.phx.gbl>, bedlaz@tin.it
says...
> Hi,
> I''m a novice in remoting, and I''ve a problem trying to make it work over
> internet.
>
> I have a SAO (Singleton) named CampusDataAccessLoader. I want clients to
> access this object in order to use it as a object-maker for another class
> (CampusDataAccess). I don''t need callback functions.
> When I work in the LAN, it''s all OK.
> Well, the server code is the simply:
>
> BinaryClientFormatterSinkProvider clientProvider = new
> BinaryClientFormatterSinkProvider();
> BinaryServerFormatterSinkProvider serverProvider = new
> BinaryServerFormatterSinkProvider();
> IDictionary props = new Hashtable();
> props["port"] = 8989;
> props["name"] = System.Guid.NewGuid().ToString();;
> HttpChannel chan = new HttpChannel(props,clientProvider, serverProvider);
> ChannelServices.RegisterChannel(chan);
> RemotingConfiguration.RegisterWellKnownServiceType(
> typeof(CampusDataAccessLoader), "CampusDataAccessLoader",
> WellKnownObjectMode.Singleton);
> While the client code is the simply:
> BinaryClientFormatterSinkProvider clientProvider = new
> BinaryClientFormatterSinkProvider();
> BinaryServerFormatterSinkProvider serverProvider = new
> BinaryServerFormatterSinkProvider();
> IDictionary props = new Hashtable();
> props["port"] = 8989;
> props["name"] = System.Guid.NewGuid().ToString();
> HttpChannel chan = new HttpChannel(props,clientProvider,serverProvider);
> ChannelServices.RegisterChannel(chan);
>
> Then the client gets the object with this instruction
> DAL = (CampusDataAccessLoader)
> Activator.GetObject(typeof(CampusDataAccessLoader),"Http://"+remserver+
> ":8989"+
> "/CampusDataAccessLoader");
> where remserver is the IP of the remote server
>
> I''m using port 8989 because I''ve read it''s firewall-friendly... but it seems
> not !
> I''ve a firewall on a server, and I''ve made a NAT on port 8989...
> what I''m missing?
> The error I''m getting is something like : System.Net.WebException:Underlying
> connection closed. Impossible to connect to the remote server.
> (The real message is in italian and is "Connessione sottostante chiusa:
> Impossibile effettuare la connessione al server remoto").
>
>
> But if i work on local network it works! So I suppose It''s a firewall
> problem...
> Can some one help me?
>
> Many thanks in advance!
> Gaetano Lazzo
>
>
>

Gaetano Lazzo

6/29/2004 3:11:00 PM

0

Thanks,
Could You tell me how please?
I''m really novice!!


"Sunny" <sunnyask@icebergwireless.com> ha scritto nel messaggio
news:%23V$MmjeXEHA.2940@TK2MSFTNGP09.phx.gbl...
> Hi,
> at server channel set use machine name property to be the external ip to
> which client connects.
>
> Sunny
>
>
> In article <upEAZYeXEHA.3044@TK2MSFTNGP09.phx.gbl>, bedlaz@tin.it
> says...
> > Hi,
> > I''m a novice in remoting, and I''ve a problem trying to make it work over
> > internet.
> >
> > I have a SAO (Singleton) named CampusDataAccessLoader. I want clients to
> > access this object in order to use it as a object-maker for another
class
> > (CampusDataAccess). I don''t need callback functions.
> > When I work in the LAN, it''s all OK.
> > Well, the server code is the simply:
> >
> > BinaryClientFormatterSinkProvider clientProvider = new
> > BinaryClientFormatterSinkProvider();
> > BinaryServerFormatterSinkProvider serverProvider = new
> > BinaryServerFormatterSinkProvider();
> > IDictionary props = new Hashtable();
> > props["port"] = 8989;
> > props["name"] = System.Guid.NewGuid().ToString();;
> > HttpChannel chan = new HttpChannel(props,clientProvider,
serverProvider);
> > ChannelServices.RegisterChannel(chan);
> > RemotingConfiguration.RegisterWellKnownServiceType(
> > typeof(CampusDataAccessLoader), "CampusDataAccessLoader",
> > WellKnownObjectMode.Singleton);
> > While the client code is the simply:
> > BinaryClientFormatterSinkProvider clientProvider = new
> > BinaryClientFormatterSinkProvider();
> > BinaryServerFormatterSinkProvider serverProvider = new
> > BinaryServerFormatterSinkProvider();
> > IDictionary props = new Hashtable();
> > props["port"] = 8989;
> > props["name"] = System.Guid.NewGuid().ToString();
> > HttpChannel chan = new HttpChannel(props,clientProvider,serverProvider);
> > ChannelServices.RegisterChannel(chan);
> >
> > Then the client gets the object with this instruction
> > DAL = (CampusDataAccessLoader)
> > Activator.GetObject(typeof(CampusDataAccessLoader),"Http://"+remserver+
> > ":8989"+
> > "/CampusDataAccessLoader");
> > where remserver is the IP of the remote server
> >
> > I''m using port 8989 because I''ve read it''s firewall-friendly... but it
seems
> > not !
> > I''ve a firewall on a server, and I''ve made a NAT on port 8989...
> > what I''m missing?
> > The error I''m getting is something like :
System.Net.WebException:Underlying
> > connection closed. Impossible to connect to the remote server.
> > (The real message is in italian and is "Connessione sottostante chiusa:
> > Impossibile effettuare la connessione al server remoto").
> >
> >
> > But if i work on local network it works! So I suppose It''s a firewall
> > problem...
> > Can some one help me?
> >
> > Many thanks in advance!
> > Gaetano Lazzo
> >
> >
> >


Sunny

6/29/2004 3:38:00 PM

0

Hi,

look inline your code:


> > > BinaryClientFormatterSinkProvider clientProvider = new
> > > BinaryClientFormatterSinkProvider();
> > > BinaryServerFormatterSinkProvider serverProvider = new
> > > BinaryServerFormatterSinkProvider();
> > > IDictionary props = new Hashtable();
> > > props["port"] = 8989;
> > > props["name"] = System.Guid.NewGuid().ToString();;

//put there the external IP of your firewall
props["machineName"] = "xxx.xxx.xxx.xxx";

//this makes the channel to use the machine name we sppecified
props["useIpAddress"] = false;

> > > HttpChannel chan = new HttpChannel(props,clientProvider,
> serverProvider);
> > > ChannelServices.RegisterChannel(chan);
......
all other is the same


Hope that helps

Sunny

Allen Anderson

6/29/2004 4:18:00 PM

0

Sunny''s answer is good advice, let me just add a little more to it if
you want to use the object from inside and outside your firewall.
Check this article I wrote on the subject out.

http://www.glacialcomp.../ArticleDetail.aspx?artic...

Allen Anderson
http://www.glacialcomp...
mailto: allen@put my website base here.com

On Tue, 29 Jun 2004 16:44:35 +0200, "Gaetano Lazzo" <bedlaz@tin.it>
wrote:

>Hi,
>I''m a novice in remoting, and I''ve a problem trying to make it work over
>internet.
>
>I have a SAO (Singleton) named CampusDataAccessLoader. I want clients to
>access this object in order to use it as a object-maker for another class
>(CampusDataAccess). I don''t need callback functions.
>When I work in the LAN, it''s all OK.
>Well, the server code is the simply:
>
>BinaryClientFormatterSinkProvider clientProvider = new
>BinaryClientFormatterSinkProvider();
>BinaryServerFormatterSinkProvider serverProvider = new
>BinaryServerFormatterSinkProvider();
>IDictionary props = new Hashtable();
>props["port"] = 8989;
>props["name"] = System.Guid.NewGuid().ToString();;
>HttpChannel chan = new HttpChannel(props,clientProvider, serverProvider);
>ChannelServices.RegisterChannel(chan);
>RemotingConfiguration.RegisterWellKnownServiceType(
>typeof(CampusDataAccessLoader), "CampusDataAccessLoader",
>WellKnownObjectMode.Singleton);
>While the client code is the simply:
>BinaryClientFormatterSinkProvider clientProvider = new
>BinaryClientFormatterSinkProvider();
>BinaryServerFormatterSinkProvider serverProvider = new
>BinaryServerFormatterSinkProvider();
>IDictionary props = new Hashtable();
>props["port"] = 8989;
>props["name"] = System.Guid.NewGuid().ToString();
>HttpChannel chan = new HttpChannel(props,clientProvider,serverProvider);
>ChannelServices.RegisterChannel(chan);
>
>Then the client gets the object with this instruction
>DAL = (CampusDataAccessLoader)
>Activator.GetObject(typeof(CampusDataAccessLoader),"Http://"+remserver+
>":8989"+
>"/CampusDataAccessLoader");
>where remserver is the IP of the remote server
>
>I''m using port 8989 because I''ve read it''s firewall-friendly... but it seems
>not !
>I''ve a firewall on a server, and I''ve made a NAT on port 8989...
>what I''m missing?
>The error I''m getting is something like : System.Net.WebException:Underlying
>connection closed. Impossible to connect to the remote server.
>(The real message is in italian and is "Connessione sottostante chiusa:
>Impossibile effettuare la connessione al server remoto").
>
>
>But if i work on local network it works! So I suppose It''s a firewall
>problem...
>Can some one help me?
>
>Many thanks in advance!
>Gaetano Lazzo
>

Gaetano Lazzo

6/30/2004 7:52:00 AM

0

It worked!!!!!

Many thanks!!

Gaetano Lazzo


"Sunny" <sunnyask@icebergwireless.com> ha scritto nel messaggio
news:uPngC8eXEHA.1152@TK2MSFTNGP09.phx.gbl...
> Hi,
>
> look inline your code:
>
>
> > > > BinaryClientFormatterSinkProvider clientProvider = new
> > > > BinaryClientFormatterSinkProvider();
> > > > BinaryServerFormatterSinkProvider serverProvider = new
> > > > BinaryServerFormatterSinkProvider();
> > > > IDictionary props = new Hashtable();
> > > > props["port"] = 8989;
> > > > props["name"] = System.Guid.NewGuid().ToString();;
>
> //put there the external IP of your firewall
> props["machineName"] = "xxx.xxx.xxx.xxx";
>
> //this makes the channel to use the machine name we sppecified
> props["useIpAddress"] = false;
>
> > > > HttpChannel chan = new HttpChannel(props,clientProvider,
> > serverProvider);
> > > > ChannelServices.RegisterChannel(chan);
> .....
> all other is the same
>
>
> Hope that helps
>
> Sunny