Re: [twsocket] TWSocketThrdServer friendly notice when disconnecting.

2007-10-11 Thread Wilfried Mestdagh
Hello dz, You have to loop through the connected clients to send them a message. and send the shutdown. Take care that clients may be disconnected while in the loop, so something like this: for n := 0 to Srv.ClientCount - 1 do try Srv.Clients[n].SendStr('bye'#13#10); Srv.Clients[n].Shu

Re: [twsocket] TWSocketThrdServer friendly notice when disconnecting.

2007-10-11 Thread DZ-Jay
Thanks, Wilfried. That's what I'm doing now. However, I'm doing it from the end of the Execute() method of the worker thread, right before destroying the server, like this: Procedure WorkerThread.Execute; Begin _InitializeSrv(); // create Try Srv.MessageLoop(); Finally Try

Re: [twsocket] TWSocketThrdServer friendly notice whendisconnecting.

2007-10-11 Thread Arno Garrels
DZ-Jay wrote: > Thanks, Wilfried. That's what I'm doing now. However, I'm doing it >> from the end of the Execute() method of the worker thread, right >> before > destroying the server, like this: > > Procedure WorkerThread.Execute; > Begin >_InitializeSrv(); // create >Try > Srv.

Re: [twsocket] TWSocketThrdServer friendly notice whendisconnecting.

2007-10-11 Thread DZ-Jay
On Oct 11, 2007, at 06:47, Arno Garrels wrote: > Iterating thru Srv.Clients is not the way to go!! It is not > thread-save and will most likely throw strange AVs. Instead > iterate thru the thread-list and post a custom message to each > thread, the inside the thread iterate thru each thread's >

Re: [twsocket] TWSocketThrdServer friendly notice whendisconnecting.

2007-10-11 Thread Arno Garrels
DZ-Jay wrote: > On Oct 11, 2007, at 06:47, Arno Garrels wrote: > >> Iterating thru Srv.Clients is not the way to go!! It is not >> thread-save and will most likely throw strange AVs. Instead >> iterate thru the thread-list and post a custom message to each >> thread, the inside the thread iterate

Re: [twsocket] TWSocketThrdServer friendly notice whendisconnecting.

2007-10-11 Thread Arno Garrels
Btw: Should read: TMessageEvent = procedure(Sender: TObject; var Msg: TMessage; var Handled: Boolean) of object; -- 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

Re: [twsocket] TWSocketThrdServer friendly notice whendisconnecting.

2007-10-11 Thread [EMAIL PROTECTED]
--- QUOTE: Arno Garrels This is untested code. Also FThreadList has to be made public. Note that OnMessage would fire in different thread contexts but a single handler for all is fine. Hope this helps. --- END. I'll look into it. --- QUOTE: Arno Garrels I think it isn't very fast, I tested once

Re: [twsocket] TWSocketThrdServer friendly notice whendisconnecting.

2007-10-11 Thread [EMAIL PROTECTED]
--- QUOTE: SZ If you do not want the ability to use multi-cores for communication threads, then async is the way to go. But IMO, it is an ill design since chipmakers are talking about 64-core CPUs and 10Gbps networks. --- END. Thanks, SZ. At this point I'm not so much concerned about complexity (

Re: [twsocket] TWSocketThrdServer friendly notice whendisconnecting.

2007-10-11 Thread Fastream Technologies
On 10/11/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > --- QUOTE: Arno Garrels > This is untested code. Also FThreadList has to be > made public. Note that OnMessage would fire in > different thread contexts but a single handler for > all is fine. Hope this helps. > --- END. > > I'll look in

Re: [twsocket] TWSocketThrdServer friendly notice whendisconnecting.

2007-10-11 Thread Fastream Technologies
I test my ICS-based MT proxy with 20k connections on our dual-core system. It performs 2GBps, local-to-local. So that's one CPU performance basically since the tester also uses CPU! I would not imagine such performance with single thread. Best Regards, SZ On 10/11/07, [EMAIL PROTECTED] <[EMAIL

Re: [twsocket] TWSocketThrdServer friendly notice whendisconnecting.

2007-10-11 Thread [EMAIL PROTECTED]
Hello: Although impressive, that type of performance is out of the scope of my application, which won't be handling more than 100 (but mostly dozens) connections at a time. I guess TWSocketServer is the way to go for me. Thank you all for the help, -dZ. >--- Original Message --

[twsocket] TWSocketServer friendly notice when disconnecting (was TWSocketThrdServer...)

2007-10-11 Thread [EMAIL PROTECTED]
Hello: Ok, now that I'm switching to TWSocketServer, my original question stands. Since all clients will run within the same thread context, then would it be safe to send the disconnect notice like Wilfried originally suggested? For example: Procedure WorkerThread.Execute; Begin _Initialize

[twsocket] Bug (yet another?) in THttpCli

2007-10-11 Thread Fastream Technologies
Hello, Please find my code at http://www.fastream.com/ics/WebStressTesterSRC.zip . Basically it is like this: void __fastcall TesterThread::startClients(void) { clientList = new TList(); TSslHttpCli *bufferClient; for(int i = 0; i < clientsPerThread; ++i) { bufferClient = new TSslHttpCli(

Re: [twsocket] TWSocketThrdServer friendly notice whendisconnecting.

2007-10-11 Thread Arno Garrels
[EMAIL PROTECTED] wrote: > Hello: >Although impressive, that type of performance is > out of the scope of my application, which won't be > handling more than 100 (but mostly dozens) > connections at a time. I guess TWSocketServer is the > way to go for me. Yes I think so. You only must ensure

Re: [twsocket] TWSocketThrdServer friendly notice whendisconnecting.

2007-10-11 Thread Arno Garrels
Fastream Technologies wrote: > I test my ICS-based MT proxy with 20k connections on our dual-core > system. It performs 2GBps, local-to-local. So that's one CPU > performance basically since the tester also uses CPU! I would not > imagine such performance with single thread. Those numbers don't te

Re: [twsocket] TWSocketThrdServer friendly notice whendisconnecting.

2007-10-11 Thread Fastream Technologies
Sure but I do not have a serious async server. You can download our MT server from our web site anytime for a test. Regards, SZ On 10/11/07, Arno Garrels <[EMAIL PROTECTED]> wrote: > > Fastream Technologies wrote: > > I test my ICS-based MT proxy with 20k connections on our dual-core > > system

Re: [twsocket] Bug (yet another?) in THttpCli (Francois, needs your attention pls)

2007-10-11 Thread Fastream Technologies
IOW, there are more messages pumped after OnRequestDone which SHOULD BE PROHIBITED OTHERWISE USE IN MT ENVIRONMENTS WOULD NOT BE POSSIBLE. Francois can you fix this bug per our consultancy agreement? Best Regards, SZ On 10/11/07, Fastream Technologies <[EMAIL PROTECTED]> wrote: > > Hello, > > P

Re: [twsocket] Bug (yet another?) in THttpCli

2007-10-11 Thread Arno Garrels
Fastream Technologies wrote: > if(method == "GET") > bufferClient->GetASync(); // here gives "Busy" error, WHY? ISN'T > THIS THE PROPER WAY TO USE THE COMPONENT?? I cannot reproduce this? Any special environment required? -- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.ht

Re: [twsocket] Bug (yet another?) in THttpCli

2007-10-11 Thread Fastream Technologies
Of course I use: USE_SSL;NO_DEBUG_LOG;NOFORMS;SECURITY_WIN32;NO_ADVANCED_HTTP_CLIENT_FEATURES in defines. Thanks, SZ On 10/11/07, Arno Garrels <[EMAIL PROTECTED]> wrote: > > Fastream Technologies wrote: > > if(method == "GET") > > bufferClient->GetASync(); // here gives "Busy" error, WHY?