private bool ConfigureListenSocket(Socket listenSocket) { for (int i = 0; i < 10; i++) { int hostPort = 10000 + (s_port.Next() % 10000); IPAddress hostIp = IPAddress.Parse(FTPActiveAddress); IPEndPoint ep = new IPEndPoint(hostIp, hostPort); try { listenSocket.Bind(ep); listenSocket.Listen(1); return(true); } catch (SocketException se) { Logging.Print(se.Message); } } return(false); }