Chimney.MPD.ChimneyMPDServer.Start C# (CSharp) Method

Start() public method

public Start ( string port, string allow = "localhost", string password = "" ) : Task
port string
allow string
password string
return Task
        public async Task<bool> Start(string port, string allow = "localhost", string password = "")
        {
            streamSocketListner = new StreamSocketListener();
            streamSocketListner.ConnectionReceived += streamSocketListner_ConnectionReceived;

            bool suc = false;

            try
            {
                await streamSocketListner.BindServiceNameAsync(port);
                suc = true;
            }
            catch
            {
                suc = false;
            }

            this.password = password;
            password_confirmed = string.IsNullOrEmpty(this.password);

            switch (allow)
            {
                case ("lan"):
                    this.allow = "lan";
                    break;
                case ("any"):
                    this.allow = "any";
                    break;
                default:
                    this.allow = "localhost";
                    break;
            }

            return suc;
        }