Example #1
0
        public RlpxPeer(IMessageSerializationService serializationService,
                        PublicKey localNodeId,
                        int localPort,
                        IHandshakeService handshakeService,
                        ISessionMonitor sessionMonitor,
                        IDisconnectsAnalyzer disconnectsAnalyzer,
                        ILogManager logManager)
        {
            // .NET Core definitely got the easy logging setup right :D
            // ResourceLeakDetector.Level = ResourceLeakDetector.DetectionLevel.Paranoid;
            // ConfigureNamedOptions<ConsoleLoggerOptions> configureNamedOptions = new("", null);
            // OptionsFactory<ConsoleLoggerOptions> optionsFactory = new(
            //     new []{ configureNamedOptions },
            //     Enumerable.Empty<IPostConfigureOptions<ConsoleLoggerOptions>>());
            // OptionsMonitor<ConsoleLoggerOptions> optionsMonitor = new(
            //     optionsFactory,
            //     Enumerable.Empty<IOptionsChangeTokenSource<ConsoleLoggerOptions>>(),
            //     new OptionsCache<ConsoleLoggerOptions>());
            // LoggerFactory loggerFactory = new(
            //     new[] { new ConsoleLoggerProvider(optionsMonitor) },
            //     new LoggerFilterOptions { MinLevel = Microsoft.Extensions.Logging.LogLevel.Warning });
            // InternalLoggerFactory.DefaultFactory = loggerFactory;

            _group = new SingleThreadEventLoop();
            _serializationService = serializationService ?? throw new ArgumentNullException(nameof(serializationService));
            _logManager           = logManager ?? throw new ArgumentNullException(nameof(logManager));
            _logger              = logManager.GetClassLogger();
            _sessionMonitor      = sessionMonitor ?? throw new ArgumentNullException(nameof(sessionMonitor));
            _disconnectsAnalyzer = disconnectsAnalyzer ?? throw new ArgumentNullException(nameof(disconnectsAnalyzer));
            _handshakeService    = handshakeService ?? throw new ArgumentNullException(nameof(handshakeService));
            LocalNodeId          = localNodeId ?? throw new ArgumentNullException(nameof(localNodeId));
            LocalPort            = localPort;
        }
 public NettyHandshakeHandler(
     IMessageSerializationService serializationService,
     IHandshakeService handshakeService,
     ISession session,
     HandshakeRole role,
     ILogManager logManager,
     IEventExecutorGroup group)
 {
     _serializationService = serializationService ?? throw new ArgumentNullException(nameof(serializationService));
     _logManager           = logManager ?? throw new ArgumentNullException(nameof(logManager));
     _logger  = logManager.GetClassLogger <NettyHandshakeHandler>();
     _role    = role;
     _group   = group;
     _service = handshakeService ?? throw new ArgumentNullException(nameof(handshakeService));
     _session = session ?? throw new ArgumentNullException(nameof(session));
     _initCompletionSource = new TaskCompletionSource <object>();
 }
Example #3
0
        public RlpxPeer(
            IMessageSerializationService serializationService,
            PublicKey localNodeId,
            int localPort,
            IHandshakeService handshakeService,
            ILogManager logManager,
            ISessionMonitor sessionMonitor)
        {
//            InternalLoggerFactory.DefaultFactory.AddProvider(new ConsoleLoggerProvider((s, level) => level > LogLevel.Warning, false));
//            ResourceLeakDetector.Level = ResourceLeakDetector.DetectionLevel.Paranoid;
            _group = new SingleThreadEventLoop();
            _serializationService = serializationService ?? throw new ArgumentNullException(nameof(serializationService));
            _logManager           = logManager ?? throw new ArgumentNullException(nameof(logManager));
            _logger           = logManager.GetClassLogger();
            _sessionMonitor   = sessionMonitor ?? throw new ArgumentNullException(nameof(sessionMonitor));
            _handshakeService = handshakeService ?? throw new ArgumentNullException(nameof(handshakeService));
            LocalNodeId       = localNodeId ?? throw new ArgumentNullException(nameof(localNodeId));
            LocalPort         = localPort;
        }
 public HandshakeInteractor(IAppSettingsService appSettingsService, IHandshakeService handshakeService, IDefaultUserUseCase defaultuser)
 {
     this._handshakeService   = handshakeService;
     this._appSettingsService = appSettingsService;
     this._defaultUser        = defaultuser;
 }