Esempio n. 1
0
        static void Main(string[] args)
        {
            string _host    = "127.0.0.1";
            int    _portRPC = 8888;
            int    _portUDP = 9999;

            Server server = new Server
            {
                Services = { FlightSimulatorService.BindService(new FlightSimulatorSeviceImpl()) },
                Ports    = { new ServerPort(_host, _portRPC, ServerCredentials.Insecure) }
            };

            server.Start();

            UdpServer udpServer = new UdpServer();

            udpServer.StartUDPListener(_portUDP);

            Console.WriteLine("Server listening on IP: " + _host);
            Console.WriteLine("Server listening on RPC port: " + _portRPC);
            Console.WriteLine("Server listening on UDP port: " + _portUDP);
            Console.WriteLine("Press any key to stop the server...");

            Console.ReadKey();

            server.ShutdownAsync().Wait();
        }
Esempio n. 2
0
 public FlightSimulatorServiceTests()
 {
     _persistenceServiceMock = new Mock <IPersistenceService>();
     _flightSimulatorService = new FlightSimulatorService(_persistenceServiceMock.Object);
 }
 public HomeController(IPersistenceService persistenceService, IConfiguration configuration)
 {
     persistenceService.InitializeService(ConfigurationExtensions.GetConnectionString(configuration, "DefaultConnection"));
     _flightSimulatorService = new FlightSimulatorService(persistenceService);
 }