public void Setup() { //SecureTestServer.config ICertificateConfig certificate = new CertificateConfig() { FilePath = @"c:\Projects\EYDAP\Code\SuperSocket-1.6\supersocket.pfx", Password = "******", ClientCertificateRequired = false, }; m_Config = new ServerConfig { Port = 555, Ip = "Any", MaxConnectionNumber = 10000, Mode = SocketMode.Tcp, Name = "NLogDevices", MaxRequestLength = 50000, //Certificate=certificate, //Security="tls" }; m_ConfigNLogClient = new ServerConfig { Port = 8200, Ip = "Any", MaxConnectionNumber = 10, Mode = SocketMode.Tcp, Name = "NLogClient", MaxRequestLength = 50000 //Certificate=certificate, //Security="tls" }; NLogDevicesServer = new MyNLogDevicesAppServer(NLogClientServer); NLogDevicesServer.Setup(new RootConfig(), m_Config, logFactory: new ConsoleLogFactory()); NLogClientServer = new myNLogClientAppServer(NLogDevicesServer); NLogClientServer.Setup(new RootConfig(), m_ConfigNLogClient, logFactory: new ConsoleLogFactory()); NLogDevicesServer.ClientAppServer = NLogClientServer; Global.serversDic.TryAdd(NLogDevicesServer.Name, NLogDevicesServer); Global.serversDic.TryAdd(NLogClientServer.Name, NLogDevicesServer); }
// Here in constructor telling to use MyReceiveFilter and MyRequestInfo public myNLogClientAppServer(MyNLogDevicesAppServer @devAppServer) : base(new DefaultReceiveFilterFactory <myNLogClientReceiveFilter, MyNLogClientReqInfo>()) { DevAppServer = @devAppServer; NewRequestReceived += ProcessNewMessage; }