Hello Francois,

Thanks for the quick reply.

No, I don't have any message handler of my own in my code.
I create an object as the owner of an array of TWSocket objects.
I assign the even handler of the TWSocket objects to a member
function of that owner object and call ReceiveStr() in the
OnDataAvailable handler. Any other reasons that you can think
of that could cause this problem?

My component verifies if a HTTP proxies supports CONNECT
on port 443. I don't think HTTPCli component does what I
want to do ...

-- 
Best regards,
Jack

Wednesday, May 18, 2005, 3:59:06 PM, you wrote:

FP> Usually, when you receive the same data twice, it is because you called the
FP> message pump from one the ICS component event handler. Never call directly
FP> or indirectly ( ShowMessage, MessageBox,...) from an event handler that is
FP> called by hardware (a data packet comes from the network) unless you really
FP> know what you are doing.

FP> btw: Do not reinvent the wheel, use the HTTP component !


FP> ----- Original Message ----- 

>> Hello Francois and all,
>>
>> I'm using a TWSocket client in LineMode with LineEnd set to #13#10.
>> I connect to a HTTP proxy server using CONNECT command. I then get
>> a reply back from the HTTP proxy from ReceiveStr()
>>
>> Things look OK except that I am receiving the data from the first
>> ReceiveStr() call twice. I get two WSocketDataAvailable messages for
>> 3 lines in the HTTP response:
>>
>>   Line 1: HTTP/1.0 200 Connection established
>>   Line 2: Proxy-agent: Proxy+ 3.00
>>   Line 3: (Blank line)
>>
>> However, I'm getting the first ReceiveStr() result twice, see below:
>> I'm getting "HTTP/1.0 200 Connection established" twice:
>>
>> 5/18/2005 2:36:43 PM WSocketDataAvailable idx=0 addr=127.0.0.1:4480
FP> ErrCode=0
>> 5/18/2005 2:36:43 PM HTTP/1.0 200 Connection established
>> 5/18/2005 2:36:43 PM
>> 5/18/2005 2:36:43 PM
>> 5/18/2005 2:36:43 PM WSocketDataAvailable idx=0 addr=127.0.0.1:4480
FP> ErrCode=0
>> 5/18/2005 2:36:43 PM HTTP/1.0 200 Connection established
>> Proxy-agent: Proxy+ 3.00
>>
>>
>> I then changed LineEnd to #13#10#13#10, I still get the result of
>> the first ReceiveStr() twice, this time the result is two lines:
>>
>>   HTTP/1.0 200 Connection established
>>   Proxy-agent: Proxy+ 3.00
>>   (Blank line)
>>
>> 5/18/2005 2:40:11 PM WSocketDataAvailable idx=0 addr=127.0.0.1:4480
FP> ErrCode=0
>> 5/18/2005 2:40:11 PM HTTP/1.0 200 Connection established
>> Proxy-agent: Proxy+ 3.00
>>
>>
>> 5/18/2005 2:40:11 PM
>> 5/18/2005 2:40:11 PM
>> 5/18/2005 2:40:11 PM WSocketDataAvailable idx=0 addr=127.0.0.1:4480
FP> ErrCode=0
>> 5/18/2005 2:40:11 PM HTTP/1.0 200 Connection established
>> Proxy-agent: Proxy+ 3.00
>>
>>
>> It seems that, somehow the first ReceiveStr() didn't remove the data
>> from the buffer. Or am I missing anything?


-- 
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

Reply via email to