GatewayDebugData.DebugContext.DebugContext C# (CSharp) Method

DebugContext() public method

public DebugContext ( string host ) : System
host string
return System
        public DebugContext(string host)
        {
            iocs = new ConnectionDataCollection(this);
            clients = new ConnectionDataCollection(this);

            string[] p = host.Split(':');

            IPAddress address;
            try
            {
                address = IPAddress.Parse(p[0]);
            }
            catch
            {
                try
                {
                    address = Dns.GetHostEntry(p[0]).AddressList.First();
                }
                catch
                {
                    return;
                }
            }

            int port = 5064;
            if (p.Length > 1)
                port = int.Parse(p[1]);
            hostName = p[0];

            server = new IPEndPoint(address, port);

            connectThread = new Thread(Reconnect);
            connectThread.IsBackground = true;
            connectThread.Start();

            collectThread = new Thread(HandleData);
            collectThread.IsBackground = true;
            collectThread.Start();
        }