// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddControllers(); //get the ip and port configuration string ip = Configuration["Ip"]; // get the ip from appsettings.json int port = Int32.Parse(Configuration["Port"]); // get the port from appsettings.json //Add the TelnetClient ITelnetClient tlc = new MyTelnetClient(ip, port); services.AddSingleton <ITelnetClient>(tlc); //Add singleton FlightGearClient IFlightGearClient fgc = new FlightGearClient(tlc); services.AddSingleton <IFlightGearClient>(fgc); //Strting going over the blocking queue fgc.Start(); }
public CommandController(FlightGearClient client) { _client = client; }
public CommandController(IConfiguration conf) { this.client = FlightGearClient.GetFlightGearClient(conf); }
public CommandController(FlightGearClient client, IConfiguration configuration) { comm_thread = client; config = configuration; }