Single TCP server, multiple client |
|
Hi!
As I mentioned in the subject my aim is to write a little programm which use one TTcpServer componenet whith multiple client connection possibility.
So I create a Thread which can handle the incoming connection requests (this thread contains the TTcpServer componenet).
My plan was the following:
- When a new client accepted the
*void __fastcall TCPServerThread::TcpServerAccept(TObject *Sender, TCustomIpClient *ClientSocket)*
method called. As you can see at this time I get the ClientSocket pointer which is a representation of the accepted client. So
I thought that If I put this pointer into an array (or a map) later I can access the accepted clients from this array. But after the TcpServerAccept method finished the ClientSocket's in the array becomes a Disconnected state.
Can you tell me why, or can you provide a sample? I found a few sample on the internet but these samples show a Single TCP server Single Client solution... :(
Thanks the answer in advance!
Csaba
|
Re: Single TCP server, multiple client |
|