Ejemplo n.º 1
0
        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);
        }
Ejemplo 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)));
 }