Hello,

None of the following events are called:

        HTTPClient->OnBeforeHeaderSend = HTTPClientBeforeHeaderSend;
        HTTPClient->OnHeaderBegin = HTTPClientHeaderBegin;
        HTTPClient->OnHeaderData = HTTPClientHeaderData;
        HTTPClient->OnHeaderEnd = HTTPClientHeaderEnd;
        HTTPClient->OnRequestDone = HTTPClientRequestDone;
        HTTPClient->OnRequestHeaderBegin = HTTPClientRequestHeaderBegin;
        HTTPClient->OnRequestHeaderEnd = HTTPClientRequestHeaderEnd;
        HTTPClient->OnDocBegin = HTTPClientDocBegin;
        HTTPClient->OnDocData = HTTPClientDocData;
        HTTPClient->OnDocEnd = HTTPClientDocEnd;
        HTTPClient->OnSendBegin = HTTPClientSendBegin;
        HTTPClient->OnSendData = HTTPClientSendData;
        HTTPClient->OnSendEnd = HTTPClientSendEnd;
        HTTPClient->OnSessionConnected = HTTPClientSessionConnected;
        HTTPClient->OnSessionClosed = HTTPClientSessionClosed;

It works without threads. There is no lasterror("0"). I have the following 
messagepump:

void __fastcall THTTPThread::messagePump(void)
{
        MSG msg;

        try
        {
                while(!Terminated && GetMessage(&msg, NULL, 0, 0))
                {
                        processServerThreadMessage(msg);
                }
        }
        catch(ESocketException &e)
        {
        }
}
//---------------------------------------------------------------------------
void __fastcall THTTPThread::processServerThreadMessage(const MSG &msg)
{
        if(msg.message == WM_HTTP_CLIENT_THREAD_ATTACH)
        {
                httpServerClientClass *clientObject = 
(httpServerClientClass*)(void*)msg.wParam;
                clientObject->ThreadAttach();
                clientObject->createHTTPClient();
        }
        else if(msg.message == WM_HTTP_CLIENT_THREAD_DETACH)
        {
                httpServerClientClass *clientObject = 
(httpServerClientClass*)(void*)msg.wParam;
                clientObject->serverThread->HTTPServerClientDisconnected(NULL, 
clientObject, msg.lParam);

                THTTPServer *HTTPServer = clientObject->FServer;

                lockCriticalSection(HTTPServer->connectDisconnectClientCS);
                delete clientObject;
                releaseCriticalSection(HTTPServer->connectDisconnectClientCS);
        }
        else
                DispatchMessage(&msg);
}
//---------------------------------------------------------------------------

FYI: In our dersign, there is the serverThread for listening and there are 2 
threads per CPU clientThreads.

Best Regards,

SubZ

----- Original Message ----- 
From: "Wilfried Mestdagh" <[EMAIL PROTECTED]>
To: "ICS support mailing" <twsocket@elists.org>
Sent: Thursday, December 01, 2005 8:52 PM
Subject: Re: [twsocket] Problem with THttpCli


> Hello SZ,
>
> I think so yes, but I'm not very familiar with THttpCli component. I use
> THttpSrv often but not the client.
>
> But to come back on your error. Can you eather put a try/catch block in
> all events, or try to debug with the IDE option 'break on delphi
> exception' on ?  I'm pretty sure the original exception is coming from a
> code fragment of you and is catched by the OnError of the ctrlSocket.
>
> I'm not 100% sure of the LastError, I just found it in the comment on
> top. I never used OnError but still it is used by THttpCli component.
>
> ---
> Rgds, Wilfried [TeamICS]
> http://www.overbyte.be/eng/overbyte/teamics.html
> http://www.mestdagh.biz
>
> Thursday, December 1, 2005, 18:50, Fastream Technologies wrote:
>
>> THttpCli(Sender....LastError reads "0" in OnSocketError.
>
>> What is unusual about my code is that I do not use a stream nor a file to
>> get the data. I want to use the OnDocData and OnHeaderData events to read
>> packet-by-packet. Is this possible? If yes how?
>
>> Regards,
>
>> SubZ
>
>> ----- Original Message ----- 
>> From: "Wilfried Mestdagh" <[EMAIL PROTECTED]>
>> To: "ICS support mailing" <twsocket@elists.org>
>> Sent: Thursday, December 01, 2005 12:18 PM
>> Subject: Re: [twsocket] Problem with THttpCli
>
>
>>> Hello SZ,
>>>
>>>> It gives no exception but throws ESocketError just after DNSLookup 
>>>> which
>>>> is
>>>> successful.
>>>
>>> Do you mean ESocketException ?
>>> What is the error ?
>>>
>>> ---
>>> Rgds, Wilfried [TeamICS]
>>> http://www.overbyte.be/eng/overbyte/teamics.html
>>> http://www.mestdagh.biz
>>>
>>> Wednesday, November 30, 2005, 15:21, Fastream Technologies wrote:
>>>
>>>> Hello,
>>>
>>>> I chose the second method (THttpCli) but the below code fails in a
>>>> thread:
>>>
>>>>         HTTPClient = new THttpCli(NULL);
>>>>         HTTPClient->MultiThreaded = true;
>>>>         HTTPClient->FollowRelocation = false;
>>>>         HTTPClient->NoCache = false;
>>>>         HTTPClient->RcvdStream = NULL;
>>>>         HTTPClient->SendStream = NULL;
>>>> // all the events are assigned here
>>>
>>> HTTPClient->>URL = "http://"; + targetServerIP + ":" + targetServerPort +
>>>> FPath;
>>>
>>>> if(FParams.Length())
>>>>                 HTTPClient->URL += "?" + FParams;
>>>
>>>> try
>>>>         {
>>>>                         HTTPClient->GetASync();
>>>>                 }
>>>> catch(...
>>>
>>>> It gives no exception but throws ESocketError just after DNSLookup 
>>>> which
>>>> is
>>>> successful. I tried with www.intel.com and the IE works just fine from
>>>> here.
>>>> I have a proxy setting for IE but that's optional and Mozilla works
>>>> without
>>>> proxy ok. I also tried to point socketspy to intel.com and used browser
>>>> to
>>>> access localhost:8000 (the port socketspy runs on) which worked but
>>>> pointing
>>>> HTTPClient did not.
>>>
>>>> Any help would be appreciated. I am using the November (downloaded 
>>>> today)
>>>> beta of ICS with -yet- no SSL.
>>>
>>>> Best Regards,
>>>
>>>> SZ
>>>
>>>
>>> -- 
>>> 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
>
>
> -- 
> 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 

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