コード例 #1
0
        static void StartServer()
        {
            ServerOptions serverOptions = ServerOptions.CreateDefault();

            serverOptions.Hosts[0].Port = 48050;

            ServerBuilder builder = new ServerBuilder();

            builder.LoadFromFile("options.json");

            builder.AddAuthenticator(new ClientAuthenticator());
            builder.AddAuthorization(new Authorization());
            builder.AddDefaultDeliveryHandler(new DeliveryHandler());
            builder.AddDefaultChannelHandler(new ChannelHandler());
            builder.AddDefaultChannelAuthenticator(new ChannelAuthenticator());

            TwinoServer twinoServer = new TwinoServer(serverOptions);

            MqServer server = builder.CreateServer();

            twinoServer.UseMqServer(server);
            twinoServer.Start();

            Console.WriteLine("Server started");
            _server = server;
        }