Пример #1
0
        public TcpNETServer(IParamsTcpServer parameters, TcpHandler handler = null)
        {
            _parameters        = parameters;
            _connectionManager = new TcpConnectionManager();

            _handler = handler ?? new TcpHandler(_parameters);
            _handler.ConnectionEvent += OnConnectionEvent;
            _handler.MessageEvent    += OnMessageEventAsync;
            _handler.ErrorEvent      += OnErrorEvent;
            _handler.ServerEvent     += OnServerEvent;
        }
Пример #2
0
        public TcpNETServer(IParamsTcpServer parameters,
                            byte[] certificate,
                            string certificatePassword,
                            TcpHandler handler = null)
        {
            _parameters        = parameters;
            _connectionManager = new TcpConnectionManager();

            _handler = handler ?? new TcpHandler(_parameters, certificate, certificatePassword);
            _handler.ConnectionEvent += OnConnectionEvent;
            _handler.MessageEvent    += OnMessageEventAsync;
            _handler.ErrorEvent      += OnErrorEvent;
            _handler.ServerEvent     += OnServerEvent;
        }
Пример #3
0
 public TcpHandler(IParamsTcpServer parameters, byte[] certificate, string certificatePassword)
 {
     _parameters          = parameters;
     _certificate         = certificate;
     _certificatePassword = certificatePassword;
 }
Пример #4
0
 public TcpHandler(IParamsTcpServer parameters)
 {
     _parameters = parameters;
 }