Example #1
0
        public void Connect()
        {
            // Set the server
            Task taskSever = new Task(() => {
                InfoServer.SetServer();
                InfoServer.Start();
            });

            Task taskClient = new Task(() => {
                CommandsChannel.AssignSocket();
            });


            Task connectionFlow = new Task(() => {
                taskSever.Start();
                taskSever.Wait();

                Console.WriteLine("Finished waiting as server");

                taskClient.Start();
                taskClient.Wait();
            });


            connectionFlow.Start();
        }
        //private InformationServer srv;
        //private InfoServer srv;

        public FlightBoardModel()
        {
            IClientHandler ch = new ClientHandler(this);

            InfoServer.RegisterClientHandler(ch);

            Console.WriteLine("flightboard connected as client");
        }
Example #3
0
 /**
  * ConnectInfoServer methods connect to info-server in asychronized mode
  * whenever the server connected, the application continiously reads data from server
  * and update data set symbol table which contains all the properties values from server
  **/
 public void ConnectInfoServer()
 {
     if (info_server != null && commands_server != null)
     {
         return;
     }
     info_server = new InfoServer(model.FlightInfoPort);
     info_server.connectToServer();
     info_server.ReadDataContinously();
 }
 InfoServerCommand(int port)
 {
     this.port = port;
     server    = new InfoServer(port);
 }
Example #5
0
 public FlightBoardModel(InfoServer info) => infoServer = info;