BCB: Multithreaded ServerClientSockets: Build a (visual) list so I can send 2 specific connected Client(s)? :(
Posted on 2003-11-25
I'm using Borland C++ Builder(6). Relatively new to programming, but excited!
I'm enthusiastically working on a chat server/client that works with standard (T)Server-/(T)ClientSockets. I managed to make it multithreaded, so when a Client Connects;
void __fastcall TMain::ServerSocketGetThread(TObject *Sender,
TServerClientWinSocket *ClientSocket, TServerClientThread *&SocketThread)
// New connection -> new Thread...
SocketThread = new TMyServerThread(false, ClientSocket);
void __fastcall TMyServerThread::ClientExecute(void)
// make sure connection is active...
while (!Terminated && ClientSocket->Connected)
// Now, use TWinSocketStream to read or write information
// over a blocking socket connection...
TWinSocketStream *pStream = new TWinSocketStream(ClientSocket, CLIENTWAITTIME);
Now the real question is how I can make a (visual) List of all the connected Clients and how can I send data to a specific Client. (Thru somekind of protocol that I can make.)
I think I should use std::map/pointers... but I'm lost... I don't anything (yet) about that, except that Pointers of course 'Point' to a specific place in memory.
Does anybody have/know an example/a tutorial or maybe some useful code(with explanation)/links?
Best regards, Roland(BE).