Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Client(Socket ClientSocket)
- {
- try
- {
- string[] array = System.IO.File.ReadAllLines("Ips.txt");
- List<string> whiteList = array.ToList();
- this.ClientSocket = ClientSocket;
- ClientStream = new NetworkStream(ClientSocket);
- EndPoint = (IPEndPoint)ClientSocket.RemoteEndPoint;
- string _ip = ((IPEndPoint)ClientSocket.RemoteEndPoint).Address.ToString();
- if (whiteList.Contains(_ip))
- {
- ClientThread = new Thread(ClientCallback);
- ClientThread.Start();
- LogFactory.GetLog(this).LogInfo("Client <{0}> connected to the server!", EndPoint);
- }
- else
- {
- LogFactory.GetLog(this).LogWarning("Client <{0}> Tried to enter the server!", _ip);
- ClientSocket.Disconnect(false);
- }
- }
- catch (Exception e) { LogFactory.GetLog(this).LogFatal(e); }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement