That's because the call to StrToInt generates an exception (at least on
my system). As Francois mentioned earlier, you are assuming in the
DataAvailable that you have the entire response, which you don't. On my
system the event is triggered 4 times with various portions of the message.
The first time it actually does contain the header, with a 403 error code
and it indicates the data portion will be 1224 bytes. The following 3
messages contain a total of 1224 bytes. Because you try to extract the
response code from each packet, strtoint ends up choking on invalid data.
Comment out the call to GetHTTPReponseStatusCode and you'll see the entire
message appear correctly in the memo box, no duplicates (at least here is it
----- Original Message -----
From: "Jack" <[EMAIL PROTECTED]>
To: "ICS support mailing" <email@example.com>
Sent: Thursday, June 02, 2005 10:42 AM
Subject: Re: [twsocket] Receive result of the first
I've uploaded the project here:
It was created with Delphi 2005. I could build it with D5
after deleting the Variant unit from uses clause.
If you build it as is, you'll see this (long) line twice:
6/2/2005 10:39:36 AM <html><body><font size="5"
color="#FF0000"><br><b>Access denied due to Proxy+'s Security
<b>Description:</b> REJECTED - by default (no rule allowed the access)
<br><b>Request details:</b> HTTPS; 126.96.36.199:4351 ->
<hr><font size="2"><font color="#FF0000">Proxy</font><font
color="#0000FF">+</font> 3.00 (Build #246), Date: Thu, 02 Jun 2005
If you comment out the StrToInt() line in the source code,
it'll appear only once.
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be