Server shuts down--no longer listening. Anyway, I decided to implement and
donate a MT web server to ICS community. So far WSocketMTSrv compiles with a
critical section for FClient list. I am working on:
{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*}
{ Called when a session is available, that is when a client is
nnecting }
procedure TCustomWSocketMTServer.TriggerSessionAvailable(Error : Word);
var
Client : TWSocketMTClient;
NewHSocket : TSocket;
begin
{$IFDEF DEBUG_OUTPUT}
OutputDebugString('OnSessionAvailable');
{$ENDIF}
{ Call parent event handler }
inherited TriggerSessionAvailable(Error);
{ In case of error, do nothing }
if Error <> 0 then
Exit;
NewHSocket := Accept;
{$IFDEF DEBUG_OUTPUT}
OutputDebugString('NewHSocket = ' + IntToStr(NewHSocket));
{$ENDIF}
Inc(FClientNum);
TriggerCreateClient(Client); // var Client : TWSocketMTClient
Client.Name := Name + 'Client' + IntToStr(FClientNum);
Client.Banner := FBanner;
Client.Server := Self;
{$IFNDEF NO_DEBUG_LOG}
Client.IcsLogger := IcsLogger; { V5.04 }
{$ENDIF}
Client.Dup(NewHSocket);
TriggerClientConnect(Client, Error);
end;
Now it is up to the user to create the TWSocketClient (=TWSocketMTClient) in
TriggerCreateClient. I wonder if the Dup could be done in worker thread of
not??
Thanks,
SZ
----- Original Message -----
From: "Arno Garrels" <[EMAIL PROTECTED]>
To: "ICS support mailing" <[email protected]>
Sent: Wednesday, March 22, 2006 7:10 PM
Subject: Re: [twsocket] WSocketTS
> Fastream Technologies wrote:
>>> WaitForSingleObject would work also but is dangerous.
>>> - First object is an event handle signaled in the worker thread
>>> after the Client has called ThreadAttach.
>>> - Second object is the thread handle so if the thread thread
>>> terminates a new attempt is made to attach to another thread.
>>
>> I tried this on the single connection per thread web server. Provided 700
>> requests/sec but failed after a min (LOCKED UP).
>
> LOCKED UP = 10061??
> --
> 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