Connecting Tech Pros Worldwide Forums | Help | Site Map

Problem: The underlying connection was closed: Unable to connectto the remote server

Kristof Thys
Guest
 
Posts: n/a
#1: Nov 16 '05
Hello,

I'm developing a C# - windows forms application. To get some information
for my application, I'm connecting to an URL, wich gives me XML
generated using php.
With 90% of the users, this code just works fine:

Expand|Select|Wrap|Line Numbers
  1.  
  2. WebRequest request = WebRequest.Create(URL);
  3.  
  4. try
  5. {
  6. request.Timeout = 50000;
  7. WebResponse response = request.GetResponse();
  8. }
  9. catch(Exception ex)
  10. {
  11. WriteToLog(LogType.Info,ex.Message.ToString());
  12. response = null;
  13. }
  14.  
  15.  
But with some users, I get an exception saying: The underlying
connection was closed: Unable to connect to the remote server

I'm sure that there is no firewall on, and I've asked the user to
disable any proxy settings...

Is there something that I'm overseeing or that can be improved to this code?


thanks in advance,

Kristof



at
Guest
 
Posts: n/a
#2: Nov 16 '05

re: Problem: The underlying connection was closed: Unable to connectto the remote server


This can happen when the request lacks something like for example a cookie.
Are there other ways in which you can connect? If so, have a look with
ethereal what goes over the wire. That sometimes gives the required
information.

"Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
news:d148vq$ksn$1@ikaria.belnet.be...[color=blue]
> Hello,
>
> I'm developing a C# - windows forms application. To get some information
> for my application, I'm connecting to an URL, wich gives me XML generated
> using php.
> With 90% of the users, this code just works fine:
>
>
Expand|Select|Wrap|Line Numbers
  1. >
  2. > WebRequest request = WebRequest.Create(URL);
  3. >
  4. > try
  5. > {
  6. > request.Timeout = 50000;
  7. > WebResponse response = request.GetResponse();
  8. > }
  9. > catch(Exception ex)
  10. > {
  11. > WriteToLog(LogType.Info,ex.Message.ToString());
  12. > response = null; }
  13. >
>
> But with some users, I get an exception saying: The underlying connection
> was closed: Unable to connect to the remote server
>
> I'm sure that there is no firewall on, and I've asked the user to disable
> any proxy settings...
>
> Is there something that I'm overseeing or that can be improved to this
> code?
>
>
> thanks in advance,
>
> Kristof[/color]


Landi
Guest
 
Posts: n/a
#3: Nov 16 '05

re: Problem: The underlying connection was closed: Unable to connectto the remote server


Kristof,
Your code is fine. It's the URL that you are connecting to that is making
your code throw an exception. I am assuming this is your server that is
giving you the XML; if so then I would make sure that the server is working
properly and that it's never loosing connection.

--
info@dowhileloop.com
http://dowhileloop.com website development
http://publicjoe.dowhileloop.com -- C# Tutorials
"Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
news:d148vq$ksn$1@ikaria.belnet.be...[color=blue]
> Hello,
>
> I'm developing a C# - windows forms application. To get some information
> for my application, I'm connecting to an URL, wich gives me XML
> generated using php.
> With 90% of the users, this code just works fine:
>
>
Expand|Select|Wrap|Line Numbers
  1. >
  2. > WebRequest request = WebRequest.Create(URL);
  3. >
  4. > try
  5. > {
  6. > request.Timeout = 50000;
  7. > WebResponse response = request.GetResponse();
  8. > }
  9. > catch(Exception ex)
  10. > {
  11. > WriteToLog(LogType.Info,ex.Message.ToString());
  12. > response = null;
  13. > }
  14. >
>
> But with some users, I get an exception saying: The underlying
> connection was closed: Unable to connect to the remote server
>
> I'm sure that there is no firewall on, and I've asked the user to
> disable any proxy settings...
>
> Is there something that I'm overseeing or that can be improved to this[/color]
code?[color=blue]
>
>
> thanks in advance,
>
> Kristof[/color]


Mezzrow
Guest
 
Posts: n/a
#4: Nov 16 '05

re: Problem: The underlying connection was closed: Unable to connectto the remote server


Yep.
When writing these types of apps its important to not presume that the
URL will be available. Its good practice to also double check the
formatting of the XML, but that's not what's happening here.

Kristof Thys
Guest
 
Posts: n/a
#5: Nov 16 '05

re: Problem: The underlying connection was closed: Unable to connectto the remote server


Mezzrow wrote:[color=blue]
> Yep.
> When writing these types of apps its important to not presume that the
> URL will be available. Its good practice to also double check the
> formatting of the XML, but that's not what's happening here.
>[/color]

The strange thing is, that with 19 of the 20 testusers, it is working
just fine. But with one user, it keeps on giving this error...
I believe it must be some kind of setting but I kind find out wich one...
It isn't the firewall, he doesn't have a proxyserver set, and the server
works fine, because at the same moment I'm able to connect...

So I'm really stuck...
at
Guest
 
Posts: n/a
#6: Nov 16 '05

re: Problem: The underlying connection was closed: Unable to connectto the remote server


What difference does ethereal show between a successfull and a failed
attempt?

"Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
news:d168e0$tho$1@ikaria.belnet.be...[color=blue]
> Mezzrow wrote:[color=green]
>> Yep.
>> When writing these types of apps its important to not presume that the
>> URL will be available. Its good practice to also double check the
>> formatting of the XML, but that's not what's happening here.
>>[/color]
>
> The strange thing is, that with 19 of the 20 testusers, it is working just
> fine. But with one user, it keeps on giving this error...
> I believe it must be some kind of setting but I kind find out wich one...
> It isn't the firewall, he doesn't have a proxyserver set, and the server
> works fine, because at the same moment I'm able to connect...
>
> So I'm really stuck...[/color]


Kristof Thys
Guest
 
Posts: n/a
#7: Nov 16 '05

re: Problem: The underlying connection was closed: Unable to connectto the remote server


I'm not that familiar with ethereal, but I tried installing it (and
wincap3.1) on my pc... But when I run my program, it doesn't seem to
catpure anything...
I don't have to run it on the server pc do I?

There is always the problem to make a program like this run on someone
elses pc, especially when he's living in Romania...

thx for you help


at wrote:[color=blue]
> What difference does ethereal show between a successfull and a failed
> attempt?
>
> "Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
> news:d168e0$tho$1@ikaria.belnet.be...
>[color=green]
>>Mezzrow wrote:
>>[color=darkred]
>>>Yep.
>>>When writing these types of apps its important to not presume that the
>>>URL will be available. Its good practice to also double check the
>>>formatting of the XML, but that's not what's happening here.
>>>[/color]
>>
>>The strange thing is, that with 19 of the 20 testusers, it is working just
>>fine. But with one user, it keeps on giving this error...
>>I believe it must be some kind of setting but I kind find out wich one...
>>It isn't the firewall, he doesn't have a proxyserver set, and the server
>>works fine, because at the same moment I'm able to connect...
>>
>>So I'm really stuck...[/color]
>
>
>[/color]
at
Guest
 
Posts: n/a
#8: Nov 16 '05

re: Problem: The underlying connection was closed: Unable to connectto the remote server


Run ethereal, select Capture/Start from the menu, select an interface (you
see the drop down on top of the ethereal screen?) (I always choose my
netcard to catch anything) and click ok. That is what I do and here it
works. When I click stop it displays what it caught (if anything, you can
test by browsisng to some page somewhere). Client/server side doesn't
matter.

Any luck?

"Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
news:d16agn$v0q$1@ikaria.belnet.be...[color=blue]
> I'm not that familiar with ethereal, but I tried installing it (and
> wincap3.1) on my pc... But when I run my program, it doesn't seem to
> catpure anything...
> I don't have to run it on the server pc do I?
>
> There is always the problem to make a program like this run on someone
> elses pc, especially when he's living in Romania...
>
> thx for you help
>
>
> at wrote:[color=green]
>> What difference does ethereal show between a successfull and a failed
>> attempt?
>>
>> "Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
>> news:d168e0$tho$1@ikaria.belnet.be...
>>[color=darkred]
>>>Mezzrow wrote:
>>>
>>>>Yep.
>>>>When writing these types of apps its important to not presume that the
>>>>URL will be available. Its good practice to also double check the
>>>>formatting of the XML, but that's not what's happening here.
>>>>
>>>
>>>The strange thing is, that with 19 of the 20 testusers, it is working
>>>just fine. But with one user, it keeps on giving this error...
>>>I believe it must be some kind of setting but I kind find out wich one...
>>>It isn't the firewall, he doesn't have a proxyserver set, and the server
>>>works fine, because at the same moment I'm able to connect...
>>>
>>>So I'm really stuck...[/color]
>>
>>[/color][/color]

Kristof Thys
Guest
 
Posts: n/a
#9: Nov 16 '05

re: Problem: The underlying connection was closed: Unable to connectto the remote server


at wrote:[color=blue]
> Run ethereal, select Capture/Start from the menu, select an interface (you
> see the drop down on top of the ethereal screen?) (I always choose my
> netcard to catch anything) and click ok. That is what I do and here it
> works. When I click stop it displays what it caught (if anything, you can
> test by browsisng to some page somewhere). Client/server side doesn't
> matter.
>
> Any luck?
>
> "Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
> news:d16agn$v0q$1@ikaria.belnet.be...
>[color=green]
>>I'm not that familiar with ethereal, but I tried installing it (and
>>wincap3.1) on my pc... But when I run my program, it doesn't seem to
>>catpure anything...
>>I don't have to run it on the server pc do I?
>>
>>There is always the problem to make a program like this run on someone
>>elses pc, especially when he's living in Romania...
>>
>>thx for you help
>>
>>
>>at wrote:
>>[color=darkred]
>>>What difference does ethereal show between a successfull and a failed
>>>attempt?
>>>
>>>"Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
>>>news:d168e0$tho$1@ikaria.belnet.be...
>>>
>>>
>>>>Mezzrow wrote:
>>>>
>>>>
>>>>>Yep.
>>>>>When writing these types of apps its important to not presume that the
>>>>>URL will be available. Its good practice to also double check the
>>>>>formatting of the XML, but that's not what's happening here.
>>>>>
>>>>
>>>>The strange thing is, that with 19 of the 20 testusers, it is working
>>>>just fine. But with one user, it keeps on giving this error...
>>>>I believe it must be some kind of setting but I kind find out wich one...
>>>>It isn't the firewall, he doesn't have a proxyserver set, and the server
>>>>works fine, because at the same moment I'm able to connect...
>>>>
>>>>So I'm really stuck...
>>>
>>>[/color][/color]
>[/color]
Ok, on my pc this works fine... I see two relevant things, one GET /URL
HTTP/1.1
and one return: HTTP/1.1 200 OK[Unreassembled Packet] with 50 packets or
so following from the same source and with the same destination saying:
Continuation or non-HTTP traffic...

I will try and do the same with the person where it doesn't work, and
I'll let you know the outcome...

Thanks for your cooperation
at
Guest
 
Posts: n/a
#10: Nov 16 '05

re: Problem: The underlying connection was closed: Unable to connectto the remote server


Please note that you can save the captured packets (just use the default
format) so you can compare later on.

In the end you should find a difference somewhere between the captured
packets. That should give you a hint on what is wrong.

"Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
news:d16eal$1oe$1@ikaria.belnet.be...[color=blue]
> at wrote:[color=green]
>> Run ethereal, select Capture/Start from the menu, select an interface
>> (you see the drop down on top of the ethereal screen?) (I always choose
>> my netcard to catch anything) and click ok. That is what I do and here it
>> works. When I click stop it displays what it caught (if anything, you can
>> test by browsisng to some page somewhere). Client/server side doesn't
>> matter.
>>
>> Any luck?
>>
>> "Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
>> news:d16agn$v0q$1@ikaria.belnet.be...
>>[color=darkred]
>>>I'm not that familiar with ethereal, but I tried installing it (and
>>>wincap3.1) on my pc... But when I run my program, it doesn't seem to
>>>catpure anything...
>>>I don't have to run it on the server pc do I?
>>>
>>>There is always the problem to make a program like this run on someone
>>>elses pc, especially when he's living in Romania...
>>>
>>>thx for you help
>>>
>>>
>>>at wrote:
>>>
>>>>What difference does ethereal show between a successfull and a failed
>>>>attempt?
>>>>
>>>>"Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
>>>>news:d168e0$tho$1@ikaria.belnet.be...
>>>>
>>>>
>>>>>Mezzrow wrote:
>>>>>
>>>>>
>>>>>>Yep.
>>>>>>When writing these types of apps its important to not presume that the
>>>>>>URL will be available. Its good practice to also double check the
>>>>>>formatting of the XML, but that's not what's happening here.
>>>>>>
>>>>>
>>>>>The strange thing is, that with 19 of the 20 testusers, it is working
>>>>>just fine. But with one user, it keeps on giving this error...
>>>>>I believe it must be some kind of setting but I kind find out wich
>>>>>one...
>>>>>It isn't the firewall, he doesn't have a proxyserver set, and the
>>>>>server works fine, because at the same moment I'm able to connect...
>>>>>
>>>>>So I'm really stuck...
>>>>
>>>>[/color]
>>[/color]
> Ok, on my pc this works fine... I see two relevant things, one GET /URL
> HTTP/1.1
> and one return: HTTP/1.1 200 OK[Unreassembled Packet] with 50 packets or
> so following from the same source and with the same destination saying:
> Continuation or non-HTTP traffic...
>
> I will try and do the same with the person where it doesn't work, and I'll
> let you know the outcome...
>
> Thanks for your cooperation[/color]


Landi
Guest
 
Posts: n/a
#11: Nov 16 '05

re: Problem: The underlying connection was closed: Unable to connectto the remote server


You are not going to catch anything with Ethereal. He is not having any
communication with the server at all and that is why his code is throwing an
exception. Even if there is anything showing up on the log he probably wont
know what to look for.
--
info@dowhileloop.com
http://dowhileloop.com website development
http://publicjoe.dowhileloop.com -- C# Tutorials

"Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
news:d148vq$ksn$1@ikaria.belnet.be...[color=blue]
> Hello,
>
> I'm developing a C# - windows forms application. To get some information
> for my application, I'm connecting to an URL, wich gives me XML
> generated using php.
> With 90% of the users, this code just works fine:
>
>
Expand|Select|Wrap|Line Numbers
  1. >
  2. > WebRequest request = WebRequest.Create(URL);
  3. >
  4. > try
  5. > {
  6. > request.Timeout = 50000;
  7. > WebResponse response = request.GetResponse();
  8. > }
  9. > catch(Exception ex)
  10. > {
  11. > WriteToLog(LogType.Info,ex.Message.ToString());
  12. > response = null;
  13. > }
  14. >
>
> But with some users, I get an exception saying: The underlying
> connection was closed: Unable to connect to the remote server
>
> I'm sure that there is no firewall on, and I've asked the user to
> disable any proxy settings...
>
> Is there something that I'm overseeing or that can be improved to this[/color]
code?[color=blue]
>
>
> thanks in advance,
>
> Kristof[/color]


at
Guest
 
Posts: n/a
#12: Nov 16 '05

re: Problem: The underlying connection was closed: Unable to connectto the remote server


Very constructive...not.

Some clients work, another one does not. What is the difference between the
packets being send from the working clients and the one that does not work?

At least I am interested to know.

"Landi" <info@dowhileloop.com> wrote in message
news:%23GrkWVWKFHA.1396@TK2MSFTNGP10.phx.gbl...[color=blue]
> You are not going to catch anything with Ethereal. He is not having any
> communication with the server at all and that is why his code is throwing
> an
> exception. Even if there is anything showing up on the log he probably
> wont
> know what to look for.
> --
> info@dowhileloop.com
> http://dowhileloop.com website development
> http://publicjoe.dowhileloop.com -- C# Tutorials
>
> "Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
> news:d148vq$ksn$1@ikaria.belnet.be...[color=green]
>> Hello,
>>
>> I'm developing a C# - windows forms application. To get some information
>> for my application, I'm connecting to an URL, wich gives me XML
>> generated using php.
>> With 90% of the users, this code just works fine:
>>
>>
Expand|Select|Wrap|Line Numbers
  1. >>
  2. >> WebRequest request = WebRequest.Create(URL);
  3. >>
  4. >> try
  5. >> {
  6. >> request.Timeout = 50000;
  7. >> WebResponse response = request.GetResponse();
  8. >> }
  9. >> catch(Exception ex)
  10. >> {
  11. >> WriteToLog(LogType.Info,ex.Message.ToString());
  12. >> response = null;
  13. >> }
  14. >>
  15. >> 
>>
>> But with some users, I get an exception saying: The underlying
>> connection was closed: Unable to connect to the remote server
>>
>> I'm sure that there is no firewall on, and I've asked the user to
>> disable any proxy settings...
>>
>> Is there something that I'm overseeing or that can be improved to this[/color]
> code?[color=green]
>>
>>
>> thanks in advance,
>>
>> Kristof[/color]
>
>[/color]


Kristof Thys
Guest
 
Posts: n/a
#13: Nov 16 '05

re: Problem: The underlying connection was closed: Unable to connectto the remote server


Landi wrote:[color=blue]
> You are not going to catch anything with Ethereal. He is not having any
> communication with the server at all and that is why his code is throwing an
> exception. Even if there is anything showing up on the log he probably wont
> know what to look for.[/color]

The question remains, why isn't there any communication?
It is possible to use a browser, IE or any other, to go to the URL from
the pc where the program throws an exception at the exact same moment...
So it seems to me, the server is just doing fine, but the client pc is
blocking the request/response for an unknown reason...

at
Guest
 
Posts: n/a
#14: Nov 16 '05

re: Problem: The underlying connection was closed: Unable to connectto the remote server


What is the url? String, uri?

What do you get in s?

string s;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse response;
try
{
response = (HttpWebResponse)request.GetResponse();
response.Close();
}
catch(Exception ex)
{
s = ex.ToString();
WriteToLog(LogType.Info, s);
}
response = null;


"Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
news:d16q4c$93a$1@ikaria.belnet.be...[color=blue]
> Landi wrote:[color=green]
>> You are not going to catch anything with Ethereal. He is not having any
>> communication with the server at all and that is why his code is throwing
>> an
>> exception. Even if there is anything showing up on the log he probably
>> wont
>> know what to look for.[/color]
>
> The question remains, why isn't there any communication?
> It is possible to use a browser, IE or any other, to go to the URL from
> the pc where the program throws an exception at the exact same moment...
> So it seems to me, the server is just doing fine, but the client pc is
> blocking the request/response for an unknown reason...
>[/color]


Kristof Thys
Guest
 
Posts: n/a
#15: Nov 16 '05

re: Problem: The underlying connection was closed: Unable to connectto the remote server


at wrote:[color=blue]
> What is the url? String, uri?
>
> What do you get in s?
>
> string s;
> HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
> HttpWebResponse response;
> try
> {
> response = (HttpWebResponse)request.GetResponse();
> response.Close();
> }
> catch(Exception ex)
> {
> s = ex.ToString();
> WriteToLog(LogType.Info, s);
> }
> response = null;
>
>
> "Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
> news:d16q4c$93a$1@ikaria.belnet.be...
>[color=green]
>>Landi wrote:
>>[color=darkred]
>>>You are not going to catch anything with Ethereal. He is not having any
>>>communication with the server at all and that is why his code is throwing
>>>an
>>>exception. Even if there is anything showing up on the log he probably
>>>wont
>>>know what to look for.[/color]
>>
>>The question remains, why isn't there any communication?
>>It is possible to use a browser, IE or any other, to go to the URL from
>>the pc where the program throws an exception at the exact same moment...
>>So it seems to me, the server is just doing fine, but the client pc is
>>blocking the request/response for an unknown reason...
>>[/color]
>
>
>[/color]
The url is
http://beta.soccerproject.com/man_to...e&pw=newsgroup

The exception I'm getting is "The underlying connection was closed:
Unable to connect to the remote server."
And right after that: System.NullReferenceException: Object reference
not set to an instance of an object.
I don't see where the second exception comes from...

The exact code is this:

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse response=null;
try
{
response = (HttpWebResponse)request.GetResponse();
response.Close();
}
catch(Exception ex)
{
WriteToLog(LogType.Info, ex.ToString());
}

if(response == null)
{
CGlobals.WriteToLog(LogType.Info,"Response = NULL");
//He's not coming here...
timeOut = true;
}

XHTML = "";
if(!timeOut)
{
StreamReader reader = new treamReader(response.GetResponseStream());
XHTML = reader.ReadToEnd();
}


BTW: Thanks for your patient help...
at
Guest
 
Posts: n/a
#16: Nov 16 '05

re: Problem: The underlying connection was closed: Unable to connectto the remote server


If you use ethereal on the serverside and run a working client, do you see
any cookie stuff in the received http headers? It looks to me the client
that does not work does not send cookie. It is my assumption that a cookie
should be passed as part of the request.

If you are unable to sit behind the server, check cookie settings on the
client.

Or, use I.E. from the failing client and see what headers get send.

"Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
news:d16r3a$9tj$1@ikaria.belnet.be...[color=blue]
> at wrote:[color=green]
>> What is the url? String, uri?
>>
>> What do you get in s?
>>
>> string s;
>> HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
>> HttpWebResponse response;
>> try
>> {
>> response = (HttpWebResponse)request.GetResponse();
>> response.Close();
>> }
>> catch(Exception ex)
>> {
>> s = ex.ToString();
>> WriteToLog(LogType.Info, s);
>> }
>> response = null;
>>
>>
>> "Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
>> news:d16q4c$93a$1@ikaria.belnet.be...
>>[color=darkred]
>>>Landi wrote:
>>>
>>>>You are not going to catch anything with Ethereal. He is not having any
>>>>communication with the server at all and that is why his code is
>>>>throwing an
>>>>exception. Even if there is anything showing up on the log he probably
>>>>wont
>>>>know what to look for.
>>>
>>>The question remains, why isn't there any communication?
>>>It is possible to use a browser, IE or any other, to go to the URL from
>>>the pc where the program throws an exception at the exact same moment...
>>>So it seems to me, the server is just doing fine, but the client pc is
>>>blocking the request/response for an unknown reason...
>>>[/color]
>>
>>
>>[/color]
> The url is
> http://beta.soccerproject.com/man_to...e&pw=newsgroup
>
> The exception I'm getting is "The underlying connection was closed: Unable
> to connect to the remote server."
> And right after that: System.NullReferenceException: Object reference not
> set to an instance of an object.
> I don't see where the second exception comes from...
>
> The exact code is this:
>
> HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
> HttpWebResponse response=null;
> try
> {
> response = (HttpWebResponse)request.GetResponse();
> response.Close();
> }
> catch(Exception ex)
> {
> WriteToLog(LogType.Info, ex.ToString());
> }
>
> if(response == null)
> {
> CGlobals.WriteToLog(LogType.Info,"Response = NULL");
> //He's not coming here...
> timeOut = true;
> }
>
> XHTML = "";
> if(!timeOut)
> {
> StreamReader reader = new treamReader(response.GetResponseStream());
> XHTML = reader.ReadToEnd();
> }
>
>
> BTW: Thanks for your patient help...[/color]


Kristof Thys
Guest
 
Posts: n/a
#17: Nov 16 '05

re: Problem: The underlying connection was closed: Unable to connectto the remote server


I don't own the server, so running ethereal there is a problem...
Running ethereal on the failing client isn't easy neither, because the
failing client situates in Romania, while I'm from Belgium...

But when I try to change my IE settings, and block all cookies,
everything keeps working... Even browsing to the url with IE...

Tricky problem :S

at wrote:[color=blue]
> If you use ethereal on the serverside and run a working client, do you see
> any cookie stuff in the received http headers? It looks to me the client
> that does not work does not send cookie. It is my assumption that a cookie
> should be passed as part of the request.
>
> If you are unable to sit behind the server, check cookie settings on the
> client.
>
> Or, use I.E. from the failing client and see what headers get send.
>
> "Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
> news:d16r3a$9tj$1@ikaria.belnet.be...
>[color=green]
>>at wrote:
>>[color=darkred]
>>>What is the url? String, uri?
>>>
>>>What do you get in s?
>>>
>>>string s;
>>>HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
>>>HttpWebResponse response;
>>>try
>>>{
>>> response = (HttpWebResponse)request.GetResponse();
>>> response.Close();
>>>}
>>>catch(Exception ex)
>>>{
>>> s = ex.ToString();
>>> WriteToLog(LogType.Info, s);
>>>}
>>>response = null;
>>>
>>>
>>>"Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
>>>news:d16q4c$93a$1@ikaria.belnet.be...
>>>
>>>
>>>>Landi wrote:
>>>>
>>>>
>>>>>You are not going to catch anything with Ethereal. He is not having any
>>>>>communication with the server at all and that is why his code is
>>>>>throwing an
>>>>>exception. Even if there is anything showing up on the log he probably
>>>>>wont
>>>>>know what to look for.
>>>>
>>>>The question remains, why isn't there any communication?
>>>>It is possible to use a browser, IE or any other, to go to the URL from
>>>>the pc where the program throws an exception at the exact same moment...
>>>>So it seems to me, the server is just doing fine, but the client pc is
>>>>blocking the request/response for an unknown reason...
>>>>
>>>
>>>
>>>[/color]
>>The url is
>>http://beta.soccerproject.com/man_to...e&pw=newsgroup
>>
>>The exception I'm getting is "The underlying connection was closed: Unable
>>to connect to the remote server."
>>And right after that: System.NullReferenceException: Object reference not
>>set to an instance of an object.
>>I don't see where the second exception comes from...
>>
>>The exact code is this:
>>
>> HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
>> HttpWebResponse response=null;
>> try
>> {
>> response = (HttpWebResponse)request.GetResponse();
>> response.Close();
>> }
>> catch(Exception ex)
>> {
>> WriteToLog(LogType.Info, ex.ToString());
>> }
>>
>> if(response == null)
>> {
>>CGlobals.WriteToLog(LogType.Info,"Response = NULL");
>>//He's not coming here...
>>timeOut = true;
>> }
>>
>> XHTML = "";
>> if(!timeOut)
>> {
>> StreamReader reader = new treamReader(response.GetResponseStream());
>> XHTML = reader.ReadToEnd();
>> }
>>
>>
>>BTW: Thanks for your patient help...[/color]
>
>
>[/color]
at
Guest
 
Posts: n/a
#18: Nov 16 '05

re: Problem: The underlying connection was closed: Unable to connectto the remote server


That makes it rather difficult! But...

Can you have the client person in Romania use a http logging proxy? So that
you can get at the headers being send? Do you run a client yourself as well
by the way? Do you get the headers it sends?


"Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
news:d16se6$ari$1@ikaria.belnet.be...[color=blue]
>I don't own the server, so running ethereal there is a problem... Running
>ethereal on the failing client isn't easy neither, because the failing
>client situates in Romania, while I'm from Belgium...
>
> But when I try to change my IE settings, and block all cookies, everything
> keeps working... Even browsing to the url with IE...
>
> Tricky problem :S
>
> at wrote:[color=green]
>> If you use ethereal on the serverside and run a working client, do you
>> see any cookie stuff in the received http headers? It looks to me the
>> client that does not work does not send cookie. It is my assumption that
>> a cookie should be passed as part of the request.
>>
>> If you are unable to sit behind the server, check cookie settings on the
>> client.
>>
>> Or, use I.E. from the failing client and see what headers get send.
>>
>> "Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
>> news:d16r3a$9tj$1@ikaria.belnet.be...
>>[color=darkred]
>>>at wrote:
>>>
>>>>What is the url? String, uri?
>>>>
>>>>What do you get in s?
>>>>
>>>>string s;
>>>>HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
>>>>HttpWebResponse response;
>>>>try
>>>>{
>>>> response = (HttpWebResponse)request.GetResponse();
>>>> response.Close();
>>>>}
>>>>catch(Exception ex)
>>>>{
>>>> s = ex.ToString();
>>>> WriteToLog(LogType.Info, s);
>>>>}
>>>>response = null;
>>>>
>>>>
>>>>"Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
>>>>news:d16q4c$93a$1@ikaria.belnet.be...
>>>>
>>>>
>>>>>Landi wrote:
>>>>>
>>>>>
>>>>>>You are not going to catch anything with Ethereal. He is not having
>>>>>>any
>>>>>>communication with the server at all and that is why his code is
>>>>>>throwing an
>>>>>>exception. Even if there is anything showing up on the log he
>>>>>>probably wont
>>>>>>know what to look for.
>>>>>
>>>>>The question remains, why isn't there any communication?
>>>>>It is possible to use a browser, IE or any other, to go to the URL from
>>>>>the pc where the program throws an exception at the exact same
>>>>>moment...
>>>>>So it seems to me, the server is just doing fine, but the client pc is
>>>>>blocking the request/response for an unknown reason...
>>>>>
>>>>
>>>>
>>>>
>>>The url is
>>>http://beta.soccerproject.com/man_to...e&pw=newsgroup
>>>
>>>The exception I'm getting is "The underlying connection was closed:
>>>Unable to connect to the remote server."
>>>And right after that: System.NullReferenceException: Object reference
>>>not set to an instance of an object.
>>>I don't see where the second exception comes from...
>>>
>>>The exact code is this:
>>>
>>> HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
>>> HttpWebResponse response=null;
>>> try
>>> {
>>> response = (HttpWebResponse)request.GetResponse();
>>> response.Close();
>>> }
>>> catch(Exception ex)
>>> {
>>> WriteToLog(LogType.Info, ex.ToString());
>>> }
>>>
>>> if(response == null)
>>> {
>>>CGlobals.WriteToLog(LogType.Info,"Response = NULL");
>>>//He's not coming here...
>>>timeOut = true;
>>> }
>>>
>>> XHTML = "";
>>> if(!timeOut)
>>> {
>>> StreamReader reader = new treamReader(response.GetResponseStream());
>>> XHTML = reader.ReadToEnd();
>>> }
>>>
>>>
>>>BTW: Thanks for your patient help...[/color]
>>
>>[/color][/color]

Kristof Thys
Guest
 
Posts: n/a
#19: Nov 16 '05

re: Problem: The underlying connection was closed: Unable to connectto the remote server


I'm sorry for my stupidity, but I don't know exactly what you are
talking about... I'm not using a http logging proxy, but where can I
download something like that and how can I use it? What does it do exactly?

thx

at wrote:[color=blue]
> That makes it rather difficult! But...
>
> Can you have the client person in Romania use a http logging proxy? So that
> you can get at the headers being send? Do you run a client yourself as well
> by the way? Do you get the headers it sends?
>
>
> "Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
> news:d16se6$ari$1@ikaria.belnet.be...
>[color=green]
>>I don't own the server, so running ethereal there is a problem... Running
>>ethereal on the failing client isn't easy neither, because the failing
>>client situates in Romania, while I'm from Belgium...
>>
>>But when I try to change my IE settings, and block all cookies, everything
>>keeps working... Even browsing to the url with IE...
>>
>>Tricky problem :S
>>
>>at wrote:
>>[color=darkred]
>>>If you use ethereal on the serverside and run a working client, do you
>>>see any cookie stuff in the received http headers? It looks to me the
>>>client that does not work does not send cookie. It is my assumption that
>>>a cookie should be passed as part of the request.
>>>
>>>If you are unable to sit behind the server, check cookie settings on the
>>>client.
>>>
>>>Or, use I.E. from the failing client and see what headers get send.
>>>
>>>"Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
>>>news:d16r3a$9tj$1@ikaria.belnet.be...
>>>
>>>
>>>>at wrote:
>>>>
>>>>
>>>>>What is the url? String, uri?
>>>>>
>>>>>What do you get in s?
>>>>>
>>>>>string s;
>>>>>HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
>>>>>HttpWebResponse response;
>>>>>try
>>>>>{
>>>>>response = (HttpWebResponse)request.GetResponse();
>>>>>response.Close();
>>>>>}
>>>>>catch(Exception ex)
>>>>>{
>>>>>s = ex.ToString();
>>>>>WriteToLog(LogType.Info, s);
>>>>>}
>>>>>response = null;
>>>>>
>>>>>
>>>>>"Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
>>>>>news:d16q4c$93a$1@ikaria.belnet.be...
>>>>>
>>>>>
>>>>>
>>>>>>Landi wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>>You are not going to catch anything with Ethereal. He is not having
>>>>>>>any
>>>>>>>communication with the server at all and that is why his code is
>>>>>>>throwing an
>>>>>>>exception. Even if there is anything showing up on the log he
>>>>>>>probably wont
>>>>>>>know what to look for.
>>>>>>
>>>>>>The question remains, why isn't there any communication?
>>>>>>It is possible to use a browser, IE or any other, to go to the URL from
>>>>>>the pc where the program throws an exception at the exact same
>>>>>>moment...
>>>>>>So it seems to me, the server is just doing fine, but the client pc is
>>>>>>blocking the request/response for an unknown reason...
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>The url is
>>>>http://beta.soccerproject.com/man_to...e&pw=newsgroup
>>>>
>>>>The exception I'm getting is "The underlying connection was closed:
>>>>Unable to connect to the remote server."
>>>>And right after that: System.NullReferenceException: Object reference
>>>>not set to an instance of an object.
>>>>I don't see where the second exception comes from...
>>>>
>>>>The exact code is this:
>>>>
>>>>HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
>>>>HttpWebResponse response=null;
>>>>try
>>>>{
>>>> response = (HttpWebResponse)request.GetResponse();
>>>> response.Close();
>>>>}
>>>>catch(Exception ex)
>>>>{
>>>> WriteToLog(LogType.Info, ex.ToString());
>>>>}
>>>>
>>>>if(response == null)
>>>>{
>>>>CGlobals.WriteToLog(LogType.Info,"Response = NULL");
>>>>//He's not coming here...
>>>>timeOut = true;
>>>>}
>>>>
>>>>XHTML = "";
>>>>if(!timeOut)
>>>>{
>>>> StreamReader reader = new treamReader(response.GetResponseStream());
>>>> XHTML = reader.ReadToEnd();
>>>>}
>>>>
>>>>
>>>>BTW: Thanks for your patient help...
>>>
>>>[/color][/color]
>[/color]
at
Guest
 
Posts: n/a
#20: Nov 16 '05

re: Problem: The underlying connection was closed: Unable to connectto the remote server


A proxy forwards requests and responses between client and server. In the
process it can save a copy of what is being send including the headers.

Client normally connect to port 80 (HTPP). When a proxy is started it
listens on another port so the client has to connect to that other port for
web access. The proxy than forwards to the target on port 80 and vice versa.
It is like a bridge. On the bridge there is a person seeing all who pass.

There are several proxies available for download on the web. Just get some
and see if you can get then running on your own machine. Once you have found
one you like (that saves headers for you) and know how it operates you can
let your Romanian customers use it.

"Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
news:d16t0s$ari$2@ikaria.belnet.be...[color=blue]
> I'm sorry for my stupidity, but I don't know exactly what you are talking
> about... I'm not using a http logging proxy, but where can I download
> something like that and how can I use it? What does it do exactly?
>
> thx
>
> at wrote:[color=green]
>> That makes it rather difficult! But...
>>
>> Can you have the client person in Romania use a http logging proxy? So
>> that you can get at the headers being send? Do you run a client yourself
>> as well by the way? Do you get the headers it sends?
>>
>>
>> "Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
>> news:d16se6$ari$1@ikaria.belnet.be...
>>[color=darkred]
>>>I don't own the server, so running ethereal there is a problem... Running
>>>ethereal on the failing client isn't easy neither, because the failing
>>>client situates in Romania, while I'm from Belgium...
>>>
>>>But when I try to change my IE settings, and block all cookies,
>>>everything keeps working... Even browsing to the url with IE...
>>>
>>>Tricky problem :S
>>>
>>>at wrote:
>>>
>>>>If you use ethereal on the serverside and run a working client, do you
>>>>see any cookie stuff in the received http headers? It looks to me the
>>>>client that does not work does not send cookie. It is my assumption that
>>>>a cookie should be passed as part of the request.
>>>>
>>>>If you are unable to sit behind the server, check cookie settings on the
>>>>client.
>>>>
>>>>Or, use I.E. from the failing client and see what headers get send.
>>>>
>>>>"Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
>>>>news:d16r3a$9tj$1@ikaria.belnet.be...
>>>>
>>>>
>>>>>at wrote:
>>>>>
>>>>>
>>>>>>What is the url? String, uri?
>>>>>>
>>>>>>What do you get in s?
>>>>>>
>>>>>>string s;
>>>>>>HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
>>>>>>HttpWebResponse response;
>>>>>>try
>>>>>>{
>>>>>>response = (HttpWebResponse)request.GetResponse();
>>>>>>response.Close();
>>>>>>}
>>>>>>catch(Exception ex)
>>>>>>{
>>>>>>s = ex.ToString();
>>>>>>WriteToLog(LogType.Info, s);
>>>>>>}
>>>>>>response = null;
>>>>>>
>>>>>>
>>>>>>"Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
>>>>>>news:d16q4c$93a$1@ikaria.belnet.be...
>>>>>>
>>>>>>
>>>>>>
>>>>>>>Landi wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>You are not going to catch anything with Ethereal. He is not having
>>>>>>>>any
>>>>>>>>communication with the server at all and that is why his code is
>>>>>>>>throwing an
>>>>>>>>exception. Even if there is anything showing up on the log he
>>>>>>>>probably wont
>>>>>>>>know what to look for.
>>>>>>>
>>>>>>>The question remains, why isn't there any communication?
>>>>>>>It is possible to use a browser, IE or any other, to go to the URL
>>>>>>>from the pc where the program throws an exception at the exact same
>>>>>>>moment...
>>>>>>>So it seems to me, the server is just doing fine, but the client pc
>>>>>>>is blocking the request/response for an unknown reason...
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>The url is
>>>>>http://beta.soccerproject.com/man_to...e&pw=newsgroup
>>>>>
>>>>>The exception I'm getting is "The underlying connection was closed:
>>>>>Unable to connect to the remote server."
>>>>>And right after that: System.NullReferenceException: Object reference
>>>>>not set to an instance of an object.
>>>>>I don't see where the second exception comes from...
>>>>>
>>>>>The exact code is this:
>>>>>
>>>>>HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
>>>>>HttpWebResponse response=null;
>>>>>try
>>>>>{
>>>>> response = (HttpWebResponse)request.GetResponse();
>>>>> response.Close();
>>>>>}
>>>>>catch(Exception ex)
>>>>>{
>>>>> WriteToLog(LogType.Info, ex.ToString());
>>>>>}
>>>>>
>>>>>if(response == null)
>>>>>{
>>>>>CGlobals.WriteToLog(LogType.Info,"Response = NULL");
>>>>>//He's not coming here...
>>>>>timeOut = true;
>>>>>}
>>>>>
>>>>>XHTML = "";
>>>>>if(!timeOut)
>>>>>{
>>>>> StreamReader reader = new treamReader(response.GetResponseStream());
>>>>> XHTML = reader.ReadToEnd();
>>>>>}
>>>>>
>>>>>
>>>>>BTW: Thanks for your patient help...
>>>>
>>>>[/color]
>>[/color][/color]


Kristof Thys
Guest
 
Posts: n/a
#21: Nov 16 '05

re: Problem: The underlying connection was closed: Unable to connectto the remote server


Unbelievable,

I just had contact with my Romanian friend... He installed ethereal and
tried it... And the program just worked...
The only thing I did was to save the generated xml in utf-8,
yesterday... That must have been the solution...

Very strange,

But thank you all for trying to help me on this one...
If you are in Belgium sometime, give me a call, I'll buy you a drink :D

ciao


Kristof Thys wrote:[color=blue]
> I'm sorry for my stupidity, but I don't know exactly what you are
> talking about... I'm not using a http logging proxy, but where can I
> download something like that and how can I use it? What does it do exactly?
>
> thx
>
> at wrote:
>[color=green]
>> That makes it rather difficult! But...
>>
>> Can you have the client person in Romania use a http logging proxy? So
>> that you can get at the headers being send? Do you run a client
>> yourself as well by the way? Do you get the headers it sends?
>>
>>
>> "Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
>> news:d16se6$ari$1@ikaria.belnet.be...
>>[color=darkred]
>>> I don't own the server, so running ethereal there is a problem...
>>> Running ethereal on the failing client isn't easy neither, because
>>> the failing client situates in Romania, while I'm from Belgium...
>>>
>>> But when I try to change my IE settings, and block all cookies,
>>> everything keeps working... Even browsing to the url with IE...
>>>
>>> Tricky problem :S
>>>
>>> at wrote:
>>>
>>>> If you use ethereal on the serverside and run a working client, do
>>>> you see any cookie stuff in the received http headers? It looks to
>>>> me the client that does not work does not send cookie. It is my
>>>> assumption that a cookie should be passed as part of the request.
>>>>
>>>> If you are unable to sit behind the server, check cookie settings on
>>>> the client.
>>>>
>>>> Or, use I.E. from the failing client and see what headers get send.
>>>>
>>>> "Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
>>>> news:d16r3a$9tj$1@ikaria.belnet.be...
>>>>
>>>>
>>>>> at wrote:
>>>>>
>>>>>
>>>>>> What is the url? String, uri?
>>>>>>
>>>>>> What do you get in s?
>>>>>>
>>>>>> string s;
>>>>>> HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
>>>>>> HttpWebResponse response;
>>>>>> try
>>>>>> {
>>>>>> response = (HttpWebResponse)request.GetResponse();
>>>>>> response.Close();
>>>>>> }
>>>>>> catch(Exception ex)
>>>>>> {
>>>>>> s = ex.ToString();
>>>>>> WriteToLog(LogType.Info, s);
>>>>>> }
>>>>>> response = null;
>>>>>>
>>>>>>
>>>>>> "Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
>>>>>> news:d16q4c$93a$1@ikaria.belnet.be...
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Landi wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> You are not going to catch anything with Ethereal. He is not
>>>>>>>> having any
>>>>>>>> communication with the server at all and that is why his code is
>>>>>>>> throwing an
>>>>>>>> exception. Even if there is anything showing up on the log he
>>>>>>>> probably wont
>>>>>>>> know what to look for.
>>>>>>>
>>>>>>>
>>>>>>> The question remains, why isn't there any communication?
>>>>>>> It is possible to use a browser, IE or any other, to go to the
>>>>>>> URL from the pc where the program throws an exception at the
>>>>>>> exact same moment...
>>>>>>> So it seems to me, the server is just doing fine, but the client
>>>>>>> pc is blocking the request/response for an unknown reason...
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>> The url is
>>>>> http://beta.soccerproject.com/man_to...e&pw=newsgroup
>>>>>
>>>>>
>>>>> The exception I'm getting is "The underlying connection was closed:
>>>>> Unable to connect to the remote server."
>>>>> And right after that: System.NullReferenceException: Object
>>>>> reference not set to an instance of an object.
>>>>> I don't see where the second exception comes from...
>>>>>
>>>>> The exact code is this:
>>>>>
>>>>> HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
>>>>> HttpWebResponse response=null;
>>>>> try
>>>>> {
>>>>> response = (HttpWebResponse)request.GetResponse();
>>>>> response.Close();
>>>>> }
>>>>> catch(Exception ex)
>>>>> {
>>>>> WriteToLog(LogType.Info, ex.ToString());
>>>>> }
>>>>>
>>>>> if(response == null)
>>>>> {
>>>>> CGlobals.WriteToLog(LogType.Info,"Response = NULL");
>>>>> //He's not coming here...
>>>>> timeOut = true;
>>>>> }
>>>>>
>>>>> XHTML = "";
>>>>> if(!timeOut)
>>>>> {
>>>>> StreamReader reader = new treamReader(response.GetResponseStream());
>>>>> XHTML = reader.ReadToEnd();
>>>>> }
>>>>>
>>>>>
>>>>> BTW: Thanks for your patient help...
>>>>
>>>>
>>>>[/color]
>>[/color][/color]
at
Guest
 
Posts: n/a
#22: Nov 16 '05

re: Problem: The underlying connection was closed: Unable to connectto the remote server


As a matter of fact I am going international coming Friday. I will be in
Brussels the whole day, Rue de Hennin.

Anyway, I take it the problem is solved? If so, I don't get it but that does
not matter ;-)

"Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
news:d16tk6$bk8$1@ikaria.belnet.be...[color=blue]
> Unbelievable,
>
> I just had contact with my Romanian friend... He installed ethereal and
> tried it... And the program just worked...
> The only thing I did was to save the generated xml in utf-8, yesterday...
> That must have been the solution...
>
> Very strange,
>
> But thank you all for trying to help me on this one...
> If you are in Belgium sometime, give me a call, I'll buy you a drink :D
>
> ciao
>
>
> Kristof Thys wrote:[color=green]
>> I'm sorry for my stupidity, but I don't know exactly what you are talking
>> about... I'm not using a http logging proxy, but where can I download
>> something like that and how can I use it? What does it do exactly?
>>
>> thx
>>
>> at wrote:
>>[color=darkred]
>>> That makes it rather difficult! But...
>>>
>>> Can you have the client person in Romania use a http logging proxy? So
>>> that you can get at the headers being send? Do you run a client yourself
>>> as well by the way? Do you get the headers it sends?
>>>
>>>
>>> "Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
>>> news:d16se6$ari$1@ikaria.belnet.be...
>>>
>>>> I don't own the server, so running ethereal there is a problem...
>>>> Running ethereal on the failing client isn't easy neither, because the
>>>> failing client situates in Romania, while I'm from Belgium...
>>>>
>>>> But when I try to change my IE settings, and block all cookies,
>>>> everything keeps working... Even browsing to the url with IE...
>>>>
>>>> Tricky problem :S
>>>>
>>>> at wrote:
>>>>
>>>>> If you use ethereal on the serverside and run a working client, do you
>>>>> see any cookie stuff in the received http headers? It looks to me the
>>>>> client that does not work does not send cookie. It is my assumption
>>>>> that a cookie should be passed as part of the request.
>>>>>
>>>>> If you are unable to sit behind the server, check cookie settings on
>>>>> the client.
>>>>>
>>>>> Or, use I.E. from the failing client and see what headers get send.
>>>>>
>>>>> "Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
>>>>> news:d16r3a$9tj$1@ikaria.belnet.be...
>>>>>
>>>>>
>>>>>> at wrote:
>>>>>>
>>>>>>
>>>>>>> What is the url? String, uri?
>>>>>>>
>>>>>>> What do you get in s?
>>>>>>>
>>>>>>> string s;
>>>>>>> HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
>>>>>>> HttpWebResponse response;
>>>>>>> try
>>>>>>> {
>>>>>>> response = (HttpWebResponse)request.GetResponse();
>>>>>>> response.Close();
>>>>>>> }
>>>>>>> catch(Exception ex)
>>>>>>> {
>>>>>>> s = ex.ToString();
>>>>>>> WriteToLog(LogType.Info, s);
>>>>>>> }
>>>>>>> response = null;
>>>>>>>
>>>>>>>
>>>>>>> "Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
>>>>>>> news:d16q4c$93a$1@ikaria.belnet.be...
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> Landi wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>> You are not going to catch anything with Ethereal. He is not
>>>>>>>>> having any
>>>>>>>>> communication with the server at all and that is why his code is
>>>>>>>>> throwing an
>>>>>>>>> exception. Even if there is anything showing up on the log he
>>>>>>>>> probably wont
>>>>>>>>> know what to look for.
>>>>>>>>
>>>>>>>>
>>>>>>>> The question remains, why isn't there any communication?
>>>>>>>> It is possible to use a browser, IE or any other, to go to the URL
>>>>>>>> from the pc where the program throws an exception at the exact same
>>>>>>>> moment...
>>>>>>>> So it seems to me, the server is just doing fine, but the client pc
>>>>>>>> is blocking the request/response for an unknown reason...
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> The url is
>>>>>> http://beta.soccerproject.com/man_to...e&pw=newsgroup
>>>>>>
>>>>>> The exception I'm getting is "The underlying connection was closed:
>>>>>> Unable to connect to the remote server."
>>>>>> And right after that: System.NullReferenceException: Object
>>>>>> reference not set to an instance of an object.
>>>>>> I don't see where the second exception comes from...
>>>>>>
>>>>>> The exact code is this:
>>>>>>
>>>>>> HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
>>>>>> HttpWebResponse response=null;
>>>>>> try
>>>>>> {
>>>>>> response = (HttpWebResponse)request.GetResponse();
>>>>>> response.Close();
>>>>>> }
>>>>>> catch(Exception ex)
>>>>>> {
>>>>>> WriteToLog(LogType.Info, ex.ToString());
>>>>>> }
>>>>>>
>>>>>> if(response == null)
>>>>>> {
>>>>>> CGlobals.WriteToLog(LogType.Info,"Response = NULL");
>>>>>> //He's not coming here...
>>>>>> timeOut = true;
>>>>>> }
>>>>>>
>>>>>> XHTML = "";
>>>>>> if(!timeOut)
>>>>>> {
>>>>>> StreamReader reader = new
>>>>>> treamReader(response.GetResponseStream());
>>>>>> XHTML = reader.ReadToEnd();
>>>>>> }
>>>>>>
>>>>>>
>>>>>> BTW: Thanks for your patient help...
>>>>>
>>>>>
>>>>>
>>>[/color][/color][/color]


at
Guest
 
Posts: n/a
#23: Nov 16 '05

re: Problem: The underlying connection was closed: Unable to connectto the remote server


This just appeared on codeproject:
http://www.codeproject.com/csharp/HTTPeep.asp

"at" <a@t> wrote in message news:4236fb61$0$43037$e4fe514c@news.xs4all.nl...[color=blue]
> As a matter of fact I am going international coming Friday. I will be in
> Brussels the whole day, Rue de Hennin.
>
> Anyway, I take it the problem is solved? If so, I don't get it but that
> does not matter ;-)
>
> "Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
> news:d16tk6$bk8$1@ikaria.belnet.be...[color=green]
>> Unbelievable,
>>
>> I just had contact with my Romanian friend... He installed ethereal and
>> tried it... And the program just worked...
>> The only thing I did was to save the generated xml in utf-8, yesterday...
>> That must have been the solution...
>>
>> Very strange,
>>
>> But thank you all for trying to help me on this one...
>> If you are in Belgium sometime, give me a call, I'll buy you a drink :D
>>
>> ciao
>>
>>
>> Kristof Thys wrote:[color=darkred]
>>> I'm sorry for my stupidity, but I don't know exactly what you are
>>> talking about... I'm not using a http logging proxy, but where can I
>>> download something like that and how can I use it? What does it do
>>> exactly?
>>>
>>> thx
>>>
>>> at wrote:
>>>
>>>> That makes it rather difficult! But...
>>>>
>>>> Can you have the client person in Romania use a http logging proxy? So
>>>> that you can get at the headers being send? Do you run a client
>>>> yourself as well by the way? Do you get the headers it sends?
>>>>
>>>>
>>>> "Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
>>>> news:d16se6$ari$1@ikaria.belnet.be...
>>>>
>>>>> I don't own the server, so running ethereal there is a problem...
>>>>> Running ethereal on the failing client isn't easy neither, because the
>>>>> failing client situates in Romania, while I'm from Belgium...
>>>>>
>>>>> But when I try to change my IE settings, and block all cookies,
>>>>> everything keeps working... Even browsing to the url with IE...
>>>>>
>>>>> Tricky problem :S
>>>>>
>>>>> at wrote:
>>>>>
>>>>>> If you use ethereal on the serverside and run a working client, do
>>>>>> you see any cookie stuff in the received http headers? It looks to me
>>>>>> the client that does not work does not send cookie. It is my
>>>>>> assumption that a cookie should be passed as part of the request.
>>>>>>
>>>>>> If you are unable to sit behind the server, check cookie settings on
>>>>>> the client.
>>>>>>
>>>>>> Or, use I.E. from the failing client and see what headers get send.
>>>>>>
>>>>>> "Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
>>>>>> news:d16r3a$9tj$1@ikaria.belnet.be...
>>>>>>
>>>>>>
>>>>>>> at wrote:
>>>>>>>
>>>>>>>
>>>>>>>> What is the url? String, uri?
>>>>>>>>
>>>>>>>> What do you get in s?
>>>>>>>>
>>>>>>>> string s;
>>>>>>>> HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
>>>>>>>> HttpWebResponse response;
>>>>>>>> try
>>>>>>>> {
>>>>>>>> response = (HttpWebResponse)request.GetResponse();
>>>>>>>> response.Close();
>>>>>>>> }
>>>>>>>> catch(Exception ex)
>>>>>>>> {
>>>>>>>> s = ex.ToString();
>>>>>>>> WriteToLog(LogType.Info, s);
>>>>>>>> }
>>>>>>>> response = null;
>>>>>>>>
>>>>>>>>
>>>>>>>> "Kristof Thys" <Kristof.Thys@luc.ac.be> wrote in message
>>>>>>>> news:d16q4c$93a$1@ikaria.belnet.be...
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>> Landi wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> You are not going to catch anything with Ethereal. He is not
>>>>>>>>>> having any
>>>>>>>>>> communication with the server at all and that is why his code is
>>>>>>>>>> throwing an
>>>>>>>>>> exception. Even if there is anything showing up on the log he
>>>>>>>>>> probably wont
>>>>>>>>>> know what to look for.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> The question remains, why isn't there any communication?
>>>>>>>>> It is possible to use a browser, IE or any other, to go to the URL
>>>>>>>>> from the pc where the program throws an exception at the exact
>>>>>>>>> same moment...
>>>>>>>>> So it seems to me, the server is just doing fine, but the client
>>>>>>>>> pc is blocking the request/response for an unknown reason...
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>> The url is
>>>>>>> http://beta.soccerproject.com/man_to...e&pw=newsgroup
>>>>>>>
>>>>>>> The exception I'm getting is "The underlying connection was closed:
>>>>>>> Unable to connect to the remote server."
>>>>>>> And right after that: System.NullReferenceException: Object
>>>>>>> reference not set to an instance of an object.
>>>>>>> I don't see where the second exception comes from...
>>>>>>>
>>>>>>> The exact code is this:
>>>>>>>
>>>>>>> HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
>>>>>>> HttpWebResponse response=null;
>>>>>>> try
>>>>>>> {
>>>>>>> response = (HttpWebResponse)request.GetResponse();
>>>>>>> response.Close();
>>>>>>> }
>>>>>>> catch(Exception ex)
>>>>>>> {
>>>>>>> WriteToLog(LogType.Info, ex.ToString());
>>>>>>> }
>>>>>>>
>>>>>>> if(response == null)
>>>>>>> {
>>>>>>> CGlobals.WriteToLog(LogType.Info,"Response = NULL");
>>>>>>> //He's not coming here...
>>>>>>> timeOut = true;
>>>>>>> }
>>>>>>>
>>>>>>> XHTML = "";
>>>>>>> if(!timeOut)
>>>>>>> {
>>>>>>> StreamReader reader = new
>>>>>>> treamReader(response.GetResponseStream());
>>>>>>> XHTML = reader.ReadToEnd();
>>>>>>> }
>>>>>>>
>>>>>>>
>>>>>>> BTW: Thanks for your patient help...
>>>>>>
>>>>>>
>>>>>>
>>>>[/color][/color]
>
>[/color]


Closed Thread