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
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
> 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
? 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:&
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
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
> 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
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
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
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
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
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
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
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
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
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
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
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
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
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
>> --- 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
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
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
--- 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 (
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
--- 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
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
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
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
>
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.
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
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
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
[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
>> 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,
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
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
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
--
> > 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
> > 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
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:
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
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
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
(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,
> > 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
> 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
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
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
>--- 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
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
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
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/
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
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
[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,
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
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
58 matches
Mail list logo