1

I have a client connection class in C#.

Client connection instance is created for every new client and I add it to a list which has a client id (identifier for a client) and the client connection instance.

public SortedList<uint, ClientConnection> clientList { get; set; }

public void AddClientToSortedList(uint clientId, ClientConnection clientConnection)
{

if (!clientList.ContainsKey(clientId))
                    clientList.Add(clientId, clientConnection);
}

Now the issue is that I have a client connection object. I need to map it to the client list to get the client id for that particular client.

I thought of using the ip address and then calculating the ip address of the clients in the list and then comparing it and eventually get the client id for the concerned client but not getting the idea how to do that.

Ayesha Gupta
  • 145
  • 4
  • 13

0 Answers0