Exemplo n.º 1
0
        private void Initialize()
        {
            var fileContent   = ReadFile(@"C:\Users\12353\Desktop\bachelor\SV\HttpListener\protocolConfig.json");
            var configuration = JsonConvert.DeserializeObject <Content>(fileContent);

            foreach (var c in configuration.PortConfig)
            {
                switch (c.Type)
                {
                case "UDP":
                    UDPManager uDPManager = new UDPManager(new DBHandler("udp_messages"));
                    uDPManager.Manage();
                    break;

                case "AMQP":
                    AMQPManager aMQPManager = new AMQPManager(new DBHandler("amqp_messages"));
                    aMQPManager.Manage();
                    break;

                default:
                    HTTPManager hTTPManager = new HTTPManager(new DBHandler("request_responses"));
                    hTTPManager.Manage();
                    break;
                }
            }
        }