I found the problem: it is with THTTPConnection descendent creation. Now I 
need to replace FWSocketServer->OnSessionAvailable with my function, which I 
could but the following code fails:

__fastcall THTTPServer::THTTPServer(TApplication *AOwner) : 
THttpServer(AOwner)
{
        OriginalSessionAvailable = FWSocketServer->OnSessionAvailable;
        SocketServer->OnSessionAvailable = SessionAvailable;
}
//---------------------------------------------------------------------------
This part above is fine.

void __fastcall THTTPServer::SessionAvailable(TObject *Client, WORD Error)
{
        THTTPThread *affinityThread = 
serverThread->httpServerClientThreadManager->getHTTPThread();

        httpClientData *data = new httpClientData();

        data->server = this;
        data->Error = Error;

        while(!PostThreadMessage(affinityThread->ThreadID, 
WM_HTTP_CLIENT_THREAD_ATTACH, (WPARAM)Client, (LPARAM)data))
                ::Sleep(1);
}
//---------------------------------------------------------------------------
This is also fine.

Now the problem is in affinityThread!

void __fastcall THTTPThread::processServerThreadMessage(const MSG &msg)
{
        if(msg.message == WM_HTTP_CLIENT_THREAD_ATTACH)
        {
                httpClientData *data = (httpClientData*)(void*)msg.lParam;
                
data->server->OriginalSessionAvailable((TObject*)(void*)msg.wParam, 
(LPARAM)data->Error); // gives infinite unnamed exceptions here!!!!!
                
PostMessage(((httpServerClientClass*)(void*)msg.wParam)->Handle, 
WM_UPDATE_CLIENT_AFFINITY, (WPARAM)this, 0);
                delete data;
        }
        else
                DispatchMessage(&msg);
}
//---------------------------------------------------------------------------

Any idea?

Best Regards,

SZ

----- Original Message ----- 
From: "Francois PIETTE" <[EMAIL PROTECTED]>
To: "ICS support mailing" <twsocket@elists.org>
Sent: Friday, February 17, 2006 8:45 PM
Subject: Re: [twsocket] Problem with Thread(At/De)tach


> You should create the smalest possible test program which reproduce the
> problem, preferably using Delphi.
> --
> [EMAIL PROTECTED]
> http://www.overbyte.be
>
> ----- Original Message ----- 
> From: "Fastream Technologies" <[EMAIL PROTECTED]>
> To: "ICS support mailing" <twsocket@elists.org>
> Sent: Friday, February 17, 2006 6:21 PM
> Subject: [twsocket] Problem with Thread(At/De)tach
>
>
>> Hello,
>>
>> I know I have brought this problem to your attention before but it
>> persists
>> and I think I have a clue. The problem has been:
>>
>> - MT
>> - NOFORMS
>> - Worker thread of http server clients is different than http server
>> itself
>>
>> Now the clue is I recognized that there is window allocation/deallocation
>> with every thread at/de-tach! So that could be the very reason why Arno
>> could find the issue with many twsocket allocations deletions. I am SURE
>> this is an ICS problem as the components give "cannot create hidden
>> window"
>> and there is no other application running! This happens with two of my
>> applications.
>>
>> Could someone take a look?
>>
>> 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