Re: [twsocket] TWSocketThrdServer

2007-10-19 Thread [EMAIL PROTECTED]
received by the server, and the entire line string is available. -dZ. >--- Original Message --- >From: Ana Onarres[mailto:[EMAIL PROTECTED] >Sent: 10/19/2007 11:35:49 AM >To : twsocket@elists.org >Cc : >Subject : RE: Re: [twsocket] TWSocketThrdServe

Re: [twsocket] TWSocketThrdServer

2007-10-19 Thread [EMAIL PROTECTED]
QUOTE: Angus None of these applications use threads, they are simply unnecessary for most ICS applications, and cause major development complications in something that should be essentially simple and reliable. END. I completely agree with Angus, and I learned it the "hard way", but enco

Re: [twsocket] TWSocketThrdServer

2007-10-19 Thread Angus Robertson - Magenta Systems Ltd
> I believe that I need a thread for every client that encapsulates > the reception of initial information and the control over the last > data sended. I have three major applications using TWSocketServer (and numerous other ICS components) each talking to multiple clients at the same time, two

Re: [twsocket] TWSocketThrdServer

2007-10-19 Thread Ana Onarres
? TWSocketThrdServer or TWSocketServer? I thank a lot your suggestions Regards. Ana. > From: [EMAIL PROTECTED]> Date: Thu, 18 Oct 2007 06:20:46 -0400> To: > twsocket@elists.org> Subject: Re: [twsocket] TWSocketThrdServer> > > On Oct > 18, 2007, at 05:36, Ana Onarres wrote:&

Re: [twsocket] TWSocketThrdServer

2007-10-18 Thread DZ-Jay
On Oct 18, 2007, at 05:36, Ana Onarres wrote: > I am confused. Clients is the property of TWSocketServer, not of > ClientThread. ClientThread extends TThread, for controling every > connection, every client socket. Anne, I was talking about the TWSocketThrdServer, not the TWSocketServe

Re: [twsocket] TWSocketThrdServer

2007-10-18 Thread Ana Onarres
t@elists.org> Subject: Re: [twsocket] TWSocketThrdServer> > > In the > examples ThrdSrvV y ThrdSrvV2, TThrdSrvClient appears with > > > TWSocketServer. It seems that it is used for adding the ClientThread > > to > TWSocketServer.> > My mistake. However, thos

Re: [twsocket] TWSocketThrdServer

2007-10-17 Thread DZ-Jay
> In the examples ThrdSrvV y ThrdSrvV2, TThrdSrvClient appears with > TWSocketServer. It seems that it is used for adding the ClientThread > to TWSocketServer. My mistake. However, those examples show how to use the single-threaded server in a multi-threaded way by handling the threads manual

Re: [twsocket] TWSocketThrdServer

2007-10-17 Thread Ana Onarres
Hello,> TThrdSrvClient is only available in TWSocketThrdServer (the > multi-threaded version), not TWSocketServer (the single-thread > version). It seems you are using TWSocketThrdServer, so the rest of my > comment will assume this. In the examples ThrdSrvV y ThrdSrvV2, TThrdSrvClient appear

Re: [twsocket] TWSocketThrdServer

2007-10-16 Thread Ana Onarres
ROTECTED]> To: twsocket@elists.org> Date: Mon, 15 Oct 2007 15:54:50 +0200> Subject: Re: [twsocket] TWSocketThrdServer> > Ana Onarres wrote:> > Hello,> > > > I want to create a server socket that accepts connections of several> > clients. Every client, first, s

Re: [twsocket] TWSocketThrdServer

2007-10-16 Thread Ana Onarres
e: Mon, 15 Oct 2007 15:54:50 +0200> Subject: Re: [twsocket] TWSocketThrdServer> > Ana Onarres wrote:> > Hello,> > > > I want to create a server socket that accepts connections of several> > clients. Every client, first, send data to server. This data are> > v

Re: [twsocket] TWSocketThrdServer

2007-10-16 Thread DZ-Jay
On Oct 16, 2007, at 07:35, Ana Onarres wrote: > I am using the TWSocketServer and have seen the examples. I have 2 > doubts: > - It is necesary to create the ClientThread and TThrdSrvClient. In > the first one, I put the code for receiving data for client, send the > server and then send data

Re: [twsocket] TWSocketThrdServer

2007-10-16 Thread Wilfried Mestdagh
Hello Ana, > I have other doubt. The application has data to server and the > server has to send them to the clients. How can i do this? > In the examples, i don't understand how the server send data to clients. For each client taht connect to the server, TWSocketServer create a data socket (you

Re: [twsocket] TWSocketThrdServer

2007-10-16 Thread Ana Onarres
n, 15 Oct 2007 > 09:38:21 -0400> Subject: Re: [twsocket] TWSocketThrdServer> > QUOTE: > Anne> What difference is between to use TWSocketThrdServer> and use > TWSocketServer with ClientThread? Which is> better for me?> END.> > > TWSocketThrdServer spa

Re: [twsocket] TWSocketThrdServer

2007-10-15 Thread [EMAIL PROTECTED]
QUOTE: Anne What difference is between to use TWSocketThrdServer and use TWSocketServer with ClientThread? Which is better for me? END. TWSocketThrdServer spawns a new thread for each incoming client (or a new thread after the maximum amount of clients per threads has been reached). TWS

Re: [twsocket] TWSocketThrdServer

2007-10-15 Thread Arno Garrels
Ana Onarres wrote: > Hello, > > I want to create a server socket that accepts connections of several > clients. Every client, first, send data to server. This data are > validated for server and then the server sends data to the client. > > What difference is between to use TWSocketThrdServer a

[twsocket] TWSocketThrdServer

2007-10-15 Thread Ana Onarres
Hello, I want to create a server socket that accepts connections of several clients. Every client, first, send data to server. This data are validated for server and then the server sends data to the client. What difference is between to use TWSocketThrdServer and use TWSocketServer with Cl

Re: [twsocket] TWSocketThrdServer friendly notice whendisconnecting.

2007-10-14 Thread Arno Garrels
Fastream Technologies wrote: > What I tried to explain was that if your program is TCP/IP-dense, > then in order to take advantage of multi-cores, you MUST code MT. That's true, but does that neccessarily mean that you MUST run socket communication in multiple threads? I can think of many other bo

Re: [twsocket] TWSocketThrdServer friendly notice whendisconnecting.

2007-10-13 Thread Fastream Technologies
What I tried to explain was that if your program is TCP/IP-dense, then in order to take advantage of multi-cores, you MUST code MT. 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

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] 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 Arno Garrels
>> --- Original Message --- >>> From: Fastream > Technologies[mailto:[EMAIL PROTECTED] >> Sent: 10/11/2007 10:08:16 AM >> To : twsocket@elists.org >> Cc : >> Subject : RE: Re: [twsocket] TWSocketThrdServer friendly notice >> whend

Re: [twsocket] TWSocketThrdServer friendly notice whendisconnecting.

2007-10-11 Thread [EMAIL PROTECTED]
Message --- >From: Fastream Technologies[mailto:[EMAIL PROTECTED] >Sent: 10/11/2007 10:08:16 AM >To : twsocket@elists.org >Cc : >Subject : RE: Re: [twsocket] TWSocketThrdServer friendly notice whendisconnecting. > >I test my ICS-based MT proxy with 20k connec

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]
--- 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 [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 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 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 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: > 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 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 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

[twsocket] TWSocketThrdServer friendly notice when disconnecting.

2007-10-10 Thread [EMAIL PROTECTED]
Hello: I've noticed that when I use Shutdown(SD_BOTH), DisconnectAll(), or Free, all clients are disconnected gracefully. However, I was wondering if there is a way to intercept that the server is shutting down, so that I can send a "Server is shutting down. Connection closed." message before c

Re: [twsocket] TWSocketThrdServer stuck in destructor loopwhenkilling threads

2007-10-04 Thread Arno Garrels
[EMAIL PROTECTED] wrote: > Now, since all exceptions are being swallowed by the > TWSocket component, if I need to kill the entire app > from, say, an event within the TWSocketThrdSrv (for > example in OnBgException), should I post a message to > the main thread, or is there a better way? You may

Re: [twsocket] TWSocketThrdServer stuck in destructor loop whenkilling threads

2007-10-04 Thread [EMAIL PROTECTED]
>> Change this. Its from top of my head so can be syntax errors. You have >> to move the destroy of the server also in the Execute mehod: Thank you, Wilfried; that worked like a charm. Now, since all exceptions are being swallowed by the TWSocket component, if I need to kill the entire app from,

Re: [twsocket] TWSocketThrdServer stuck in destructor loop when killing threads

2007-10-04 Thread Wilfried Mestdagh
Hello dz, Change this. Its from top of my head so can be syntax errors. You have to move the destroy of the server also in the Execute mehod: Destructor TServerThrd.Destroy; Begin Try // this must in the Execute method // If Assigned(FSocketSrv) Then Begin // FSocketSrv.Fr

[twsocket] TWSocketThrdServer stuck in destructor loop when killing threads

2007-10-04 Thread [EMAIL PROTECTED]
Hello: I'm having a problem with the TWSocketThrdServer. My application has a worker thread that contains a TWSocketThrdServer member to handle all incoming requests. When the main thread finishes, it sends a WM_QUIT message to the worker thread, which then finishes and frees the TWSocketThrdS

Re: [twsocket] TWSocketThrdServer - BogusOnDataAvailabletriggeredwhen Closed.

2007-10-03 Thread Wilfried Mestdagh
Hello dz, > Client.SendLine('-ERR Closing connection.'); > Client.Shutdown(1); // Or CloseDelayed() ...? Yes. This way you are sure that the string will be received by the other end. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz --

Re: [twsocket] TWSocketThrdServer - BogusOnDataAvailabletriggeredwhen Closed.

2007-10-03 Thread [EMAIL PROTECTED]
> > I think the problem is that in TCustomWSocket.InternalClose the message > > pump is called > > I think you right about that. As I recall CloseDelayed was introduced if > it was needed to Close from in one of the events. Most likely that was > the reason. So should I call CloseDelayed() or

Re: [twsocket] TWSocketThrdServer - Bogus OnDataAvailabletriggeredwhen Closed.

2007-10-03 Thread [EMAIL PROTECTED]
> > Close() ultimately calls Shutdown(1) -- so wouldn't it have the same > > effect? > > As I recall not exacly the same. Close calls Shutdown(1) and close the > socket. If you call Shutdown(1) the socket will not be immediatly close, > but if there is still some data it will be send, and the othe

Re: [twsocket] TWSocketThrdServer - Bogus OnDataAvailabletriggeredwhen Closed.

2007-10-03 Thread Wilfried Mestdagh
Hello Arno, > I think the problem is that in TCustomWSocket.InternalClose the message > pump is called I think you right about that. As I recall CloseDelayed was introduced if it was needed to Close from in one of the events. Most likely that was the reason. --- Rgds, Wilfried [TeamICS] http:

Re: [twsocket] TWSocketThrdServer - Bogus OnDataAvailabletriggeredwhen Closed.

2007-10-03 Thread Arno Garrels
Wilfried Mestdagh wrote: > Hello DZ-Jay, > >> Close() ultimately calls Shutdown(1) -- so wouldn't it have the same >> effect? > > As I recall not exacly the same. Close calls Shutdown(1) and close the > socket. If you call Shutdown(1) the socket will not be immediatly > close, but if there is sti

Re: [twsocket] TWSocketThrdServer - Bogus OnDataAvailable triggeredwhen Closed.

2007-10-03 Thread Wilfried Mestdagh
Hello DZ-Jay, > Close() ultimately calls Shutdown(1) -- so wouldn't it have the same > effect? As I recall not exacly the same. Close calls Shutdown(1) and close the socket. If you call Shutdown(1) the socket will not be immediatly close, but if there is still some data it will be send, and the o

Re: [twsocket] TWSocketThrdServer - Bogus OnDataAvailable triggeredwhen Closed.

2007-10-03 Thread DZ-Jay
On Oct 3, 2007, at 03:53, Arno Garrels wrote: > CloseDelayed won't reenter the event, however to ensure that > last data packets are received properly before the socket is > closed call ShutDown() for a gracefull close in DataSent event > handler. Thanks all for the responses. I have one more q

Re: [twsocket] TWSocketThrdServer - Bogus OnDataAvailable triggeredwhen Closed.

2007-10-03 Thread Arno Garrels
(Internet Component Suite, freeware) >> Author of MidWare (Multi-tier framework, freeware) >> http://www.overbyte.be >> >> >> - Original Message - >> From: <[EMAIL PROTECTED]> >> To: >> Sent: Wednesday, October 03,

Re: [twsocket] TWSocketThrdServer - Bogus OnDataAvailable triggeredwhen Closed.

2007-10-03 Thread Francois Piette
> > You should call Shutdown to gracefully close the connection. > > If you want to call close, do it using an intermediate custom message. > Isn't it what CloseDelayed is meant for? Yes, of course ! -- [EMAIL PROTECTED] Author of ICS (Internet Component Suite, freeware) Author of MidWare (Multi

Re: [twsocket] TWSocketThrdServer - Bogus OnDataAvailable triggeredwhen Closed.

2007-10-03 Thread Olivier Sannier
> Author of MidWare (Multi-tier framework, freeware) > http://www.overbyte.be > > > - Original Message - > From: <[EMAIL PROTECTED]> > To: > Sent: Wednesday, October 03, 2007 12:04 AM > Subject: [twsocket] TWSocketThrdServer - Bogus OnDataAvailable trigge

Re: [twsocket] TWSocketThrdServer - Bogus OnDataAvailable triggeredwhen Closed.

2007-10-03 Thread Francois Piette
Message - From: <[EMAIL PROTECTED]> To: Sent: Wednesday, October 03, 2007 12:04 AM Subject: [twsocket] TWSocketThrdServer - Bogus OnDataAvailable triggeredwhen Closed. > Hello: > I'm using TWSocketThrdServer and processing > client data from within the OnDataAvail

[twsocket] TWSocketThrdServer - Bogus OnDataAvailable triggered when Closed.

2007-10-02 Thread [EMAIL PROTECTED]
Hello: I'm using TWSocketThrdServer and processing client data from within the OnDataAvailable event handler (client is set to LineMode=True). I've noticed that if the data transaction is completed and I call Client.Close from within this event, the event is called again with the previous Rece

Re: [twsocket] TWSocketThrdServer graceful shutdown

2007-09-28 Thread [EMAIL PROTECTED]
>--- Original Message --- >From: Arno Garrels[mailto:[EMAIL PROTECTED] > > Isn't this list great? Where else do you get faster support for > free software? Yes, it is. Thank you both for your quick responses. -dZ. -- To unsubscribe or change your settings for TWSocket mailing

Re: [twsocket] TWSocketThrdServer graceful shutdown

2007-09-28 Thread Wilfried Mestdagh
Friday, September 28, 2007, 20:36, Arno Garrels wrote: > Wilfried Mestdagh wrote: >> Hello Arno, >> >>> Most likely Wilfried is faster again ;-) >> >> most of the time you are faster :) > Isn't this list great? Where else do you get faster support for > free software? Indeed. Sometime I have

Re: [twsocket] TWSocketThrdServer graceful shutdown

2007-09-28 Thread Arno Garrels
Wilfried Mestdagh wrote: > Hello Arno, > >> Most likely Wilfried is faster again ;-) > > most of the time you are faster :) Isn't this list great? Where else do you get faster support for free software? -- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html -- To unsubscr

Re: [twsocket] TWSocketThrdServer graceful shutdown

2007-09-28 Thread Wilfried Mestdagh
Hello Arno, > Most likely Wilfried is faster again ;-) most of the time you are faster :) --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/

Re: [twsocket] TWSocketThrdServer graceful shutdown

2007-09-28 Thread Arno Garrels
gt;> Sent: 9/28/2007 12:03:57 PM >> To : twsocket@elists.org >> Cc : >> Subject : RE: Re: [twsocket] TWSocketThrdServer > graceful shutdown >> > >Hello dz, > > Just call Close method. server will stop listening. > Note that calling > Close

Re: [twsocket] TWSocketThrdServer graceful shutdown

2007-09-28 Thread [EMAIL PROTECTED]
Mestdagh[mailto:[EMAIL PROTECTED] >Sent: 9/28/2007 12:03:57 PM >To : twsocket@elists.org >Cc : >Subject : RE: Re: [twsocket] TWSocketThrdServer graceful shutdown > >Hello dz, Just call Close method. server will stop listening. Note that calling Close will not stop

Re: [twsocket] TWSocketThrdServer graceful shutdown

2007-09-28 Thread Arno Garrels
[EMAIL PROTECTED] wrote: > Hello: > I using TWSocketThrdServer in a server > application and was wondering if there is a > recommended method to call for a graceful shutdown -- > one that will stop listening when all current > connections are completed. Call Close, that just stops listening,

Re: [twsocket] TWSocketThrdServer graceful shutdown

2007-09-28 Thread Wilfried Mestdagh
Hello dz, Just call Close method. server will stop listening. Note that calling Close will not stop current connections, it only stops listening. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Friday, September 28, 2007, 17:44, [EMAIL PROTEC

[twsocket] TWSocketThrdServer graceful shutdown

2007-09-28 Thread [EMAIL PROTECTED]
Hello: I using TWSocketThrdServer in a server application and was wondering if there is a recommended method to call for a graceful shutdown -- one that will stop listening when all current connections are completed. Thanks, -dZ. -- To unsubscribe or change your settings for TWSoc