Hello Francois,
The system compiles and runs now. It gives 790 requests/sec on my XP Home :)
until time_wait sockets reach a certain level where it starts to drop
connections!! (httpServerThread is the listener thread. Inside it there is a
THTTPServer which is a descendent of THttpMTServer of Pascal.)
Example C++ Usage of the attached code:
Now TriggerClientConnect and disconnect are called from worker thread
context.
void __fastcall THTTPThread::processServerThreadMessage(const MSG &msg)
{
if(msg.message == WM_HTTP_CLIENT_THREAD_ATTACH) // detachment is done in
serverThread
{
TWSocketMTServer *socketServer =
(TWSocketMTServer*)(void*)msg.wParam;
httpServerClientClass *httpClient = new
httpServerClientClass(socketServer);
httpClient->affinityThread = this;
socketServer->AfterClientCreated(httpClient, 0, msg.lParam);
}
else
DispatchMessage(msg);
// this is the worker thread message pump
void __fastcall httpServerThread::HTTPServerCreateClient(int NewHSocket)
{
THTTPThread *affinityThread =
httpServerClientThreadManager->getHTTPThread();
if(affinityThread)
while(!PostThreadMessage(affinityThread->ThreadID,
WM_HTTP_CLIENT_THREAD_ATTACH, (WPARAM)HTTPServer->WSocketServer,
(LPARAM)NewHSocket))
::Sleep(1);
}
//---------------------------------------------------------------------------
Now the slight problem: when I run in debug mode in Memproof, I get 11MB
used report but task manager reports 45MB after a 5min test! This is a big
problem for end user tests!!!
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