コード例 #1
0
 public TcpExt(ExtendedActorSystem system)
 {
     _settings   = new TcpSettings(system.Settings.Config.GetConfig("akka.io.tcp"));
     _bufferPool = new DirectByteBufferPool(_settings.DirectBufferSize, _settings.MaxDirectBufferPoolSize);
     //_fileIoDispatcher = system.Dispatchers.Lookup(_settings.FileIODispatcher);
     _manager = system.SystemActorOf(
         props: Props.Create(() => new TcpManager(this))
         .WithDispatcher(_settings.ManagementDispatcher)
         .WithDeploy(Deploy.Local),
         name: "IO-TCP");
 }
コード例 #2
0
        internal TcpExt(ExtendedActorSystem system, TcpSettings settings)
        {
            var bufferPoolConfig = system.Settings.Config.GetConfig(settings.BufferPoolConfigPath);

            if (bufferPoolConfig.IsNullOrEmpty())
            {
                throw new ConfigurationException($"Cannot retrieve TCP buffer pool configuration: {settings.BufferPoolConfigPath} configuration node not found");
            }

            Settings         = settings;
            FileIoDispatcher = system.Dispatchers.Lookup(Settings.FileIODispatcher);
            BufferPool       = CreateBufferPool(system, bufferPoolConfig);
            Manager          = system.SystemActorOf(
                props: Props.Create(() => new TcpManager(this)).WithDispatcher(Settings.ManagementDispatcher).WithDeploy(Deploy.Local),
                name: "IO-TCP");
        }
コード例 #3
0
        internal TcpExt(ExtendedActorSystem system, TcpSettings settings)
        {
            var bufferPoolConfig = system.Settings.Config.GetConfig(settings.BufferPoolConfigPath);

            if (bufferPoolConfig == null)
            {
                throw new ArgumentNullException(nameof(settings), $"Couldn't find a HOCON config for `{settings.BufferPoolConfigPath}`");
            }

            Settings            = settings;
            FileIoDispatcher    = system.Dispatchers.Lookup(Settings.FileIODispatcher);
            BufferPool          = CreateBufferPool(system, bufferPoolConfig);
            SocketEventArgsPool = new PreallocatedSocketEventAgrsPool(settings.InitialSocketAsyncEventArgs, OnComplete);
            Manager             = system.SystemActorOf(
                props: Props.Create(() => new TcpManager(this)).WithDispatcher(Settings.ManagementDispatcher).WithDeploy(Deploy.Local),
                name: "IO-TCP");
        }
コード例 #4
0
 public TcpExt(ExtendedActorSystem system) : this(system, TcpSettings.Create(system))
 {
 }