I'm trying to make a Socket (Server -> Client), however I want to make a whitelist of ip that can be accepted in the client connection to the server, however I do not know how, Server check if the ip that is in the "whitelist" that will be an array, if ip have the connection the client will be accepted if you do not have the ip the will not connect!.
Server:
public Client(Socket ClientSocket)
{
//Client = this;
this.ClientSocket = ClientSocket;
ClientStream = new NetworkStream(ClientSocket);
EndPoint = (IPEndPoint)ClientSocket.RemoteEndPoint;
ClientThread = new Thread(ClientCallback);
ClientThread.Start();
LogFactory.GetLog(this).LogInfo("Client <{0}> connected to the server!", EndPoint);
}