LCM.LCM.LCM.LCM C# (CSharp) Méthode

LCM() public méthode

Create a new LCM object, connecting to one or more URLs. If no URL is specified, the environment variable LCM_DEFAULT_URL is used. If that environment variable is not defined, then the default URL is used.
public LCM ( ) : System
Résultat System
        public LCM(params string[] urls)
        {
            if (urls.Length == 0)
			{
				string env = Environment.GetEnvironmentVariable("LCM_DEFAULT_URL");

                if (env == null)
                {
                    urls = new string[] { "udpm://239.255.76.67:7667" };
                }
                else
                {
                    urls = new string[] { env };
                }
			}
			
			foreach (string url in urls)
			{
				URLParser up = new URLParser(url);
				string protocol = up.Get("protocol");

                if (protocol.Equals("udpm"))
                {
                    providers.Add(new UDPMulticastProvider(this, up));
                }
                else if (protocol.Equals("tcpq"))
                {
                    providers.Add(new TCPProvider(this, up));
                }/*
                else if (protocol.Equals("file"))
                {
                    providers.Add(new LogFileProvider(this, up));
                }*/
                else
                {
                    Console.Error.WriteLine("LCM: Unknown URL protocol: " + protocol);
                }
			}
		}