I am developing a chat program in C# that an open telnet port for administration. The deal is that every time a client connects to the server, the server stores his nickname and socket in a hashlist. Is there a way to retrieve the TcpClient back so that I can do TcpClient.Disconnect() or Close() ?
My Code:
// When the client enters the server
clientsList.Add(dataFromClient, clientSocket);
// This will add the nick and tcpclient to the Hashtable
Is there a way to retrieve it back so that I can do Close() or disconnect() ?
This should give tou TcpClient: