예제 #1
0
        public static async Task Main()
        {
            Console.Title = "InterReact";
            Console.SetWindowSize(100, 30);
            Console.SetBufferSize(100, 100);

            var serverLoggerFactory  = new MyLoggerFactory("Server: ", ConsoleColor.DarkMagenta);
            var clientLoggerFactory  = new MyLoggerFactory("Client: ", ConsoleColor.DarkYellow);
            var libraryLoggerFactory = new MyLoggerFactory("ClientLibrary: ", ConsoleColor.DarkCyan);

            var serverTask = new Client(Port, clientLoggerFactory.CreateLogger(), libraryLoggerFactory).Run();
            var clientTask = new Server(Port, serverLoggerFactory.CreateLogger <RxSocketServer>()).Run();

            await Task.WhenAll(clientTask, serverTask);

            await Task.Delay(1000);

            Console.ResetColor();
        }
예제 #2
0
 internal Client(int port, ILogger logger, MyLoggerFactory loggerFactory)
 {
     Port          = port;
     Logger        = logger;
     LoggerFactory = loggerFactory;
 }