Re: Am I using ThreadPool the right way?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi Ignacio!

Thank you very much for your advice and interest!

Kind regards,

Ricardo.

I'm programming a TCP server.
During the stress tests I noticed that maybe my socket-receiving thread
became deaf after an hour of heavy stress.

You should have a thread just to receive new connections, once a
connection is received a new thread is created and that thread is the one
that handle that connection. This allows you to receive new incomming
calls.

The "worker thread" can either use async or sync request. I think it
depends of what are you transfering.

You are right, of course. But I already have this:
A thread listening for connections.
When a new client connects I get a new socket, and I create a new client
object with it; somthing like this:
------------------------------------
while(!m_stopServer)
{
try
{
clientSocket = m_server.AcceptSocket();
socketListener = new ClientThread(m_maq, clientSocket);
lock(clients.SyncRoot)
{
clients[socketListener.ClientSocket] = socketListener;
}
socketListener.StartSocketListener();
}
catch ... etc.
...
}
------------------------------------
But, as you see, the new client starts a receiving thread:
socketListener.StartSocketListener().
This is the thread I was talking about, the one that got stuck after one
hour of stress testing, the one I was trying to de-couple: the
client-instance receiving thread.




.



Relevant Pages

  • Re: Access 2007->SQL Server2005 "connection was forcibly closed",G
    ... I think it will ameliorate the situation if you clean up the client as ... And to come back to my problem: I think with help of the SQL Server admins ... closed connections - but all of these errors are in the version which used ... Every new client opens again 30 connections if I open 30 tables ...
    (microsoft.public.sqlserver.connect)
  • Re: Getting management to move from green screen
    ... You CAN show progress/status with a GUI (at least you can with MY tool ... suggest this is a problem with the technology you have chosen, ... synchronous operations that lock up client connections, ...
    (comp.databases.pick)
  • Re: How do I tell an object to free up an owned object from thta object itself?
    ... I tested running a sequence of connect/disconnect from the client ... client address for those connections that were active. ... In the ClientConnect event I create a handler object for processing ... >Socket is in fact a TServerClientWinSocket which acts as a end-connection ...
    (comp.lang.pascal.delphi.misc)
  • RE: Issue with user profile folders and outlook
    ... I have received the Event Log and had a look at it. ... the SID should be resolved to the account name. ... Try to log onto the client with that account and check how it works. ... Connections, ...
    (microsoft.public.windows.server.sbs)
  • Re: RTC remoting > Explained in 11 minutes
    ... transport components for connections between clients and servers. ... server response but also server request (to client) -> client response) ... handed off to the different attached plugin command handlers which have ...
    (borland.public.delphi.thirdpartytools.general)