Example #1
0
        public static List <IPEndPoint> GetEndpoints(int port, params string[] servers)
        {
            List <IPEndPoint> ip = new List <IPEndPoint>();

            foreach (string server in servers)
            {
                if (IPUtil.isValidAddress(server))
                {
                    ip.Add(new IPEndPoint(IPAddress.Parse(server), port));
                }
            }
            return(ip);
        }
Example #2
0
 public TLServer_IP(string ipaddr, int port, int wait, int TickBufferSize, DebugDelegate deb)
 {
     SendDebugEvent = deb;
     if (TickBufferSize == 0)
     {
         _queueb4send = false;
     }
     else
     {
         tickq = new RingBuffer <Tick>(TickBufferSize);
     }
     MinorVer = Util.ProgramBuild(Util.PROGRAM, debug);
     _wait    = wait;
     if (!IPUtil.isValidAddress(ipaddr))
     {
         debug("Not valid ip address: " + ipaddr + ", using localhost.");
     }
     _addr = IPUtil.isValidAddress(ipaddr) ? IPAddress.Parse(ipaddr) : IPAddress.Loopback;
     _port = port;
     v("tlserver_ip wait: " + _wait);
     Start();
 }