RAD Studio VCL Reference
|
Simulates OnClientRead and OnClientWrite events for the associated server socket.
procedure ClientExecute; virtual;
virtual __fastcall ClientExecute();
TServerClientThread calls ClientExecute from its Execute method. ClientExecute checks whether there is any information to read from the associated socket connection, and if so, simulates an OnClientRead event on the associated server socket. If there is no information sent from the client, ClientExecute simulates an OnClientWrite event.
Because the server socket that receives these events is not local to the thread, the events occur within the main VCL thread using the Synchronize method. This method can be too slow if the server socket has many client connections, because each thread must wait for any other thread to finish reading or writing. When a server socket receives many client connection requests, override ClientExecute to handle the reading or writing using a thread-local instance of TWinSocketStream. In the ClientExecute method, be sure to check the Terminated property periodically.
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|