[lnkForumImage]
TotalShareware - Download Free Software

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


 

Eddie Stone

10/7/2004 12:16:00 PM

Hi All,

This is a follow up to my previous post. What I want to achieve is to be
able to have a client pass information to a server where the client is an
asp.net webpage and server is in a windows forms app.

The setup I created with a CAO on the server accessed by
Activator.GetObject() on the client works fine accept in the hosting
environment I have to work with. I presume that incoming requests are
somehow blocked.

I have tried it seems everything : using a 'shim', CAO factory, Ingos
bidirectional class and even the mighty Genuine channels, there seems to be
no way round it.

So what I need is an alternative, anything that allows me to send even a
string to my app from the webpage will do.

Is there any other way to handle events of remoting object on the server ?

TIA.
6 Answers

Ken Kolda

10/7/2004 3:34:00 PM

0

From what I recall, you found that you couldn't even use telnet from the
client to connect to the remote server on the port it listens on, right? If
that's the case and connection is being blocked somewhere between client and
server (e.g. by a firewall), then there's no remoting-related solution
that's going to get around that. You'll need to find out what's preventing
the basic connection from occurring.

Ken


"Eddie Stone" <nospam@spammy.org> wrote in message
news:Xns957B86E5B9B2Bkjdkjsjfskjcom@207.46.248.16...
> Hi All,
>
> This is a follow up to my previous post. What I want to achieve is to be
> able to have a client pass information to a server where the client is an
> asp.net webpage and server is in a windows forms app.
>
> The setup I created with a CAO on the server accessed by
> Activator.GetObject() on the client works fine accept in the hosting
> environment I have to work with. I presume that incoming requests are
> somehow blocked.
>
> I have tried it seems everything : using a 'shim', CAO factory, Ingos
> bidirectional class and even the mighty Genuine channels, there seems to
be
> no way round it.
>
> So what I need is an alternative, anything that allows me to send even a
> string to my app from the webpage will do.
>
> Is there any other way to handle events of remoting object on the server ?
>
> TIA.


Nergal

10/7/2004 5:13:00 PM

0

Ken I think its only the incoming requests thats blocked due to this part
of the error.

[SocketException (0x274c): A connection attempt failed because the
connected party did not properly respond after a period of time, or
established connection failed because connected host has failed to respond]
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg)


I was wondering if there was a way to tranmit my request outward only, or
is this just crazy talk ? ;).

Thanks for your help.




"Ken Kolda" <ken.kolda@elliemae-nospamplease.com> wrote in
news:#oeOuMIrEHA.2544@TK2MSFTNGP10.phx.gbl:

> From what I recall, you found that you couldn't even use telnet from
> the client to connect to the remote server on the port it listens on,
> right? If that's the case and connection is being blocked somewhere
> between client and server (e.g. by a firewall), then there's no
> remoting-related solution that's going to get around that. You'll need
> to find out what's preventing the basic connection from occurring.
>
> Ken
>
>
> "Eddie Stone" <nospam@spammy.org> wrote in message
> news:Xns957B86E5B9B2Bkjdkjsjfskjcom@207.46.248.16...
>> Hi All,
>>
>> This is a follow up to my previous post. What I want to achieve is to
>> be able to have a client pass information to a server where the
>> client is an asp.net webpage and server is in a windows forms app.
>>
>> The setup I created with a CAO on the server accessed by
>> Activator.GetObject() on the client works fine accept in the hosting
>> environment I have to work with. I presume that incoming requests are
>> somehow blocked.
>>
>> I have tried it seems everything : using a 'shim', CAO factory, Ingos
>> bidirectional class and even the mighty Genuine channels, there seems
>> to
> be
>> no way round it.
>>
>> So what I need is an alternative, anything that allows me to send
>> even a string to my app from the webpage will do.
>>
>> Is there any other way to handle events of remoting object on the
>> server ?
>>
>> TIA.
>
>
>



--
¬¬¬¬nergal¬¬¬¬

Ken Kolda

10/7/2004 6:17:00 PM

0

This is exactly the kind of exception I would expect you would get when
there's a firewall between the client and server. For example, just create a
trivial console app with the following lines of code in your Main()
function:

////// CODE STARTS HERE
ChannelServices.RegisterChannel(new TcpChannel());

try
{
object o = Activator.GetObject(typeof(IA),
"tcp://www.yahoo.com:1000/MyServer.rem");
Console.Write(o.ToString());
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}

Console.ReadLine();
/////// CODE ENDS HERE

Of course this remoting call is going to fail since yahoo.com isn't hosting
a remoting object. But notice the error message and call stack -- you should
see the same thing you're seeing on your system. That's because Yahoo's
firewall simply threw out the packets your computer sends so your system has
to wait until the timeout elapses and then displays this error. I think it's
unlikely that a firewall would have allowed the connection to succeeded but
then block the packets being returned from the server.

Ken


"Nergal" <kjdkjs@jfskj.com> wrote in message
news:Xns957BB9634ACB8kjdkjsjfskjcom@207.46.248.16...
> Ken I think its only the incoming requests thats blocked due to this part
> of the error.
>
> [SocketException (0x274c): A connection attempt failed because the
> connected party did not properly respond after a period of time, or
> established connection failed because connected host has failed to
respond]
> System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
> reqMsg, IMessage retMsg)
>
>
> I was wondering if there was a way to tranmit my request outward only, or
> is this just crazy talk ? ;).
>
> Thanks for your help.
>
>
>
>
> "Ken Kolda" <ken.kolda@elliemae-nospamplease.com> wrote in
> news:#oeOuMIrEHA.2544@TK2MSFTNGP10.phx.gbl:
>
> > From what I recall, you found that you couldn't even use telnet from
> > the client to connect to the remote server on the port it listens on,
> > right? If that's the case and connection is being blocked somewhere
> > between client and server (e.g. by a firewall), then there's no
> > remoting-related solution that's going to get around that. You'll need
> > to find out what's preventing the basic connection from occurring.
> >
> > Ken
> >
> >
> > "Eddie Stone" <nospam@spammy.org> wrote in message
> > news:Xns957B86E5B9B2Bkjdkjsjfskjcom@207.46.248.16...
> >> Hi All,
> >>
> >> This is a follow up to my previous post. What I want to achieve is to
> >> be able to have a client pass information to a server where the
> >> client is an asp.net webpage and server is in a windows forms app.
> >>
> >> The setup I created with a CAO on the server accessed by
> >> Activator.GetObject() on the client works fine accept in the hosting
> >> environment I have to work with. I presume that incoming requests are
> >> somehow blocked.
> >>
> >> I have tried it seems everything : using a 'shim', CAO factory, Ingos
> >> bidirectional class and even the mighty Genuine channels, there seems
> >> to
> > be
> >> no way round it.
> >>
> >> So what I need is an alternative, anything that allows me to send
> >> even a string to my app from the webpage will do.
> >>
> >> Is there any other way to handle events of remoting object on the
> >> server ?
> >>
> >> TIA.
> >
> >
> >
>
>
>
> --
> ¬¬¬¬nergal¬¬¬¬


Eddie Stone

10/7/2004 8:07:00 PM

0

Hi Ken,

I can see what you mean, your test did fail in the same way. However on
my set-up the firewall on my machine which hosts the server is not
blocking requests like this.

I know this because my samples work with clients on other remote
machines which I access from gotomypc and from another asp.net website.

Also the webserver where the client fails does not block outgoing
requests because I wrote a little sample to download yahoo homepage
using

System.Net.WebClient();

I know I'm clutching at straws but I wonder if there is anyway to
utilise remoting to use this outgoing connection to contact my server
with some info. If its not possible then I can start looking at a new
host, smart clients and other kinds of workarouds.

Your help is much appreciated.



"Ken Kolda" <ken.kolda@elliemae-nospamplease.com> wrote in
news:eTCybnJrEHA.2724@TK2MSFTNGP14.phx.gbl:

> ChannelServices.RegisterChannel(new TcpChannel());
>
> try
> {
> object o = Activator.GetObject(typeof(IA),
> "tcp://www.yahoo.com:1000/MyServer.rem");
> Console.Write(o.ToString());
> }
> catch (Exception ex)
> {
> Console.WriteLine(ex.ToString());
> }
>
> Console.ReadLine();

Ken Kolda

10/7/2004 8:41:00 PM

0

Well, just because you can connect to a remote web server via HTTP doesn't
mean there isn't a firewall blocking some outbound connections. Firewalls
are certainly able to filter based on the target port number and/or the
actual packet contents. It also could be that requests on port 80 go through
a special proxy server they have which allows them to work.

In the end, here's the thing to know: if you can't establish a telnet
connection to your server on the port it's listening on, then remoting isn't
going to work. One thing you could try is to host your remote objects under
IIS. If, indeed, the remote client can access web sites, then it may be able
to use your remote object over HTTP/port 80.

I'm not sure what you mean by "I wonder if there is anyway to utilise
remoting to use this outgoing connection to contact my server with some
info". As far as I know you can't establish an outgoing connection to your
server. Until that problem is resolved, remoting won't work.

If you want to perform one more test, you could do this:

1) On your remote object server, create a simple console App that uses the
TcpListener to listen on whatever port you usually host your remote objects
on. For example:

TcpListener listener = new TcpListener(IPAddress.Any, 2000);
listener.Start();

while (true)
{
TcpClient client = listener.AcceptTcpClient();
Console.Writeline("Accepted connection from: " + ((IPEndPoint)
client.Client.RemoteEndPoint).Address);
client.Close();
}

2) On your client machine, use the TcpClient object to try to connect to it.

TcpClient client = new TcpClient();
client.Connect("123.222.80.26", 2000);

This is essentially what remoting is doing at its lowest levels (when you
use the TcpChannel), so if you can't get a connection to your server in this
way, remoting won't work.

Ken


"Eddie Stone" <nospam@spammy.org> wrote in message
news:Xns957BD6E1F62FBnospamspammyorg@207.46.248.16...
> Hi Ken,
>
> I can see what you mean, your test did fail in the same way. However on
> my set-up the firewall on my machine which hosts the server is not
> blocking requests like this.
>
> I know this because my samples work with clients on other remote
> machines which I access from gotomypc and from another asp.net website.
>
> Also the webserver where the client fails does not block outgoing
> requests because I wrote a little sample to download yahoo homepage
> using
>
> System.Net.WebClient();
>
> I know I'm clutching at straws but I wonder if there is anyway to
> utilise remoting to use this outgoing connection to contact my server
> with some info. If its not possible then I can start looking at a new
> host, smart clients and other kinds of workarouds.
>
> Your help is much appreciated.
>
>
>
> "Ken Kolda" <ken.kolda@elliemae-nospamplease.com> wrote in
> news:eTCybnJrEHA.2724@TK2MSFTNGP14.phx.gbl:
>
> > ChannelServices.RegisterChannel(new TcpChannel());
> >
> > try
> > {
> > object o = Activator.GetObject(typeof(IA),
> > "tcp://www.yahoo.com:1000/MyServer.rem");
> > Console.Write(o.ToString());
> > }
> > catch (Exception ex)
> > {
> > Console.WriteLine(ex.ToString());
> > }
> >
> > Console.ReadLine();
>


Eddie Stone

10/7/2004 11:26:00 PM

0

As you suspected the test did not work. I got the old :

[SocketException (0x274c): A connection attempt failed because the
connected party did not properly respond after a period of time, or
established connection failed because connected host has failed to respond]

So I have to try another approach, a smart client would solve alot of
problems but bring a whole lot more I supose... ;)

Thanks again for your great help.


"Ken Kolda" <ken.kolda@elliemae-nospamplease.com> wrote in
news:eoVLV4KrEHA.3080@TK2MSFTNGP15.phx.gbl:

> TcpClient client = new TcpClient();
> client.Connect("123.222.80.26", 2000);