private static void handleClient(Socket socket2Client, int ipepIndex) { Tunnel tunnel2Add = new Tunnel(socket2Client, null, Conf.encryptionKey); bool result = RequestHandler.Handle(tunnel2Add); if (result) { tunnel2Add.Flow(); } else { tunnel2Add.Close(); } reqGotNumbers.Down(); }
private static void _handleClient(object socket2ClientObj) { Socket socket2Client = socket2ClientObj as Socket; byte[] buffer = new byte[1024]; int read; try { read = socket2Client.Receive(buffer); } catch { read = 0; } if (read > 0) { byte[] req = new byte[read]; Array.Copy(buffer, req, read); Tunnel tunnel = RequestHandler.Handle(req, socket2Client); if (tunnel != null) { tunnel.Flow(); lock (clients) { clients.Enqueue(tunnel); } } } }