Пример #1
0
        // Our connector
        // We load this first. See the ini [Startup] ServiceConnectors
        // We give the port we want our applications to connect to us, the
        // name of the dll (determined by the "name=Wx.Connector" in the
        // WxConnectors/prebuild.xml) and the name of the class in the
        // dll assembly that we want to use...
        // ServiceConnectors = "8114/Wx.Connector.dll:WxServiceConnector"
        //
        // In the [Network] section we have configured an ssl port on 8114
        // So, we will use https://* to talk to our application server.
        //
        // We load our Wx.Service (see: Wx.Service/Wx.ServiceBase)
        //
        // Then we pass our server the handler that is given the Wx.Service
        //
        public WxExampleServiceConnector(IConfigSource config, IHttpServer server, string configName)
            : base(config, server, configName)
        {
            IConfig serverConfig = config.Configs[m_ConfigName];
            if (serverConfig == null)
                throw new Exception(String.Format("No section {0} in config file", m_ConfigName));

            string WxExampleService = serverConfig.GetString("LocalServiceModule",
                    String.Empty);

            if (WxExampleService == String.Empty)
                throw new Exception("No LocalServiceModule in config file");

            Object[] args = new Object[] { config };
            m_WxExampleService = ServerUtils.LoadPlugin<IWxExampleService>(WxExampleService, args);

            server.AddStreamHandler(new WxExampleHandlers(m_WxExampleService));
        }
Пример #2
0
        // Our connector
        // We load this first. See the ini [Startup] ServiceConnectors
        // We give the port we want our applications to connect to us, the
        // name of the dll (determined by the "name=Wx.Connector" in the
        // WxConnectors/prebuild.xml) and the name of the class in the
        // dll assembly that we want to use...
        // ServiceConnectors = "8114/Wx.Connector.dll:WxServiceConnector"
        //
        // In the [Network] section we have configured an ssl port on 8114
        // So, we will use https://* to talk to our application server.
        //
        // We load our Wx.Service (see: Wx.Service/Wx.ServiceBase)
        //
        // Then we pass our server the handler that is given the Wx.Service
        //
        public WxExampleServiceConnector(IConfigSource config, IHttpServer server, string configName)
            : base(config, server, configName)
        {
            IConfig serverConfig = config.Configs[m_ConfigName];

            if (serverConfig == null)
            {
                throw new Exception(String.Format("No section {0} in config file", m_ConfigName));
            }

            string WxExampleService = serverConfig.GetString("LocalServiceModule",
                                                             String.Empty);

            if (WxExampleService == String.Empty)
            {
                throw new Exception("No LocalServiceModule in config file");
            }

            Object[] args = new Object[] { config };
            m_WxExampleService = ServerUtils.LoadPlugin <IWxExampleService>(WxExampleService, args);

            server.AddStreamHandler(new WxExampleHandlers(m_WxExampleService));
        }
Пример #3
0
 public WxExampleHandlers(IWxExampleService service) : base("POST", "/WxExample")
 {
     m_Service = service;
     m_log.Info("[WxExampleHandler]: Loading");
 }
Пример #4
0
 public WxExampleHandlers(IWxExampleService service)
     : base("POST", "/WxExample")
 {
     m_Service = service;
     m_log.Info("[WxExampleHandler]: Loading");
 }