public static async Task <int> Run(ServerOptions options)
        {
            MqttServer server = new MqttServer(IPAddress.Parse(options.IpAddress), options.Port);
            await server.StartAsync();

            Console.ReadLine();
            return(0);
        }
Esempio n. 2
0
 async static Task <int> Main(string[] args)
 {
     return(await CommandLine.Parser.Default
            .ParseArguments <MockObjectOptions, ServerOptions>(args)
            .MapResult(
                (MockObjectOptions opts) => MockObject.Run(opts),
                (ServerOptions opts) => MqttServer.Run(opts),
                errs => Task.FromResult(1)));
 }