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 spawns a new thread for each incoming client (or a new
thread
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
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 validated for server and then the server sends data to the
client
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
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 and use
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).
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);
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
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
--- 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 into it.
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 tell
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
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
//
[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 want
Message -
From: [EMAIL PROTECTED]
To: twsocket@elists.org
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 OnDataAvailable event
(Multi-tier framework, freeware)
http://www.overbyte.be
- Original Message -
From: [EMAIL PROTECTED]
To: twsocket@elists.org
Sent: Wednesday, October 03, 2007 12:04 AM
Subject: [twsocket] TWSocketThrdServer - Bogus OnDataAvailable triggeredwhen
Closed.
Hello:
I'm using
-tier framework, freeware)
http://www.overbyte.be
- Original Message -
From: [EMAIL PROTECTED]
To: twsocket@elists.org
Sent: Wednesday, October 03, 2007 12:04 AM
Subject: [twsocket] TWSocketThrdServer - Bogus OnDataAvailable
triggeredwhen Closed.
Hello:
I'm using
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
--
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
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
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
[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,
:[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 current connections, it only
stops listening
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
: RE: Re: [twsocket] TWSocketThrdServer
graceful shutdown
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
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? g
--
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
--
To unsubscribe
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? g
Indeed. Sometime I have the feeling
--- Original Message ---
From: Arno Garrels[mailto:[EMAIL PROTECTED]
Isn't this list great? Where else do you get faster
support for
free software? g
Yes, it is. Thank you both for your quick responses.
-dZ.
--
To unsubscribe or change your settings for TWSocket mailing
29 matches
Mail list logo