コード例 #1
0
        public TcpSslSession(Socket socket, ATcpOptions options, PipeScheduler scheduler, MemoryPool <byte> pool, SslFeature sslFeature, FilterPipeline <ITcpSession> filterPipeline)
            : base(socket, options, scheduler, pool, filterPipeline)
        {
            var inputPipeOptions  = StreamPipeOptionsHelper.ReaderOptionsCreator(pool);
            var outputPipeOptions = StreamPipeOptionsHelper.WriterOptionsCreator(pool);
            var sslDuplexPipe     = new SslStreamDuplexPipe(base.Transport, inputPipeOptions, outputPipeOptions, sslFeature.sslStreamFactory);

            this.sslTransport = sslDuplexPipe;
            this.sslOptions   = sslFeature.sslOptions;
        }
コード例 #2
0
ファイル: ATcpSession.cs プロジェクト: gedo4547/letter
        public ATcpSession(Socket socket, ATcpOptions options, PipeScheduler scheduler, MemoryPool <byte> pool, FilterPipeline <ITcpSession> filterPipeline)
        {
            this.Id                 = IdGeneratorHelper.GetNextId();
            this.Order              = options.Order;
            this.MemoryPool         = pool;
            this.Scheduler          = scheduler;
            this.MemoryPool         = pool;
            this.Scheduler          = scheduler;
            this.minAllocBufferSize = this.MemoryPool.MaxBufferSize / 2;

            this.filterPipeline = filterPipeline;
            this.socket         = new TcpSocket(socket, scheduler);
            this.LocalAddress   = this.socket.BindAddress;
            this.RemoteAddress  = this.socket.RemoteAddress;

            this.SettingSocket(this.socket, options);
            this.SettingPipeline(options.MaxPipelineReadBufferSize, options.MaxPipelineWriteBufferSize);
        }
コード例 #3
0
ファイル: ATcpSession.cs プロジェクト: gedo4547/letter
        private void SettingSocket(TcpSocket socket, ATcpOptions options)
        {
            this.socket.SettingKeepAlive(options.KeepAlive);
            this.socket.SettingLingerState(options.LingerOption);
            this.socket.SettingNoDelay(options.NoDelay);

            if (options.RcvTimeout != null)
            {
                this.socket.SettingRcvTimeout(options.RcvTimeout.Value);
            }
            if (options.SndTimeout != null)
            {
                this.socket.SettingSndTimeout(options.SndTimeout.Value);
            }
            if (options.RcvBufferSize != null)
            {
                this.socket.SettingRcvBufferSize(options.RcvBufferSize.Value);
            }
            if (options.SndBufferSize != null)
            {
                this.socket.SettingSndBufferSize(options.SndBufferSize.Value);
            }
        }
コード例 #4
0
ファイル: ATcpChannel.cs プロジェクト: gedo4547/letter
 private ATcpSession CreateSslSession(Socket socket, ATcpOptions options, PipeScheduler scheduler, MemoryPool <byte> pool)
 {
     return(new TcpSslSession(socket, options, scheduler, pool, this.sslFeature, this.CreateFilterPipeline()));
 }
コード例 #5
0
ファイル: TcpSession.cs プロジェクト: gedo4547/letter
 public TcpSession(Socket socket, ATcpOptions options, PipeScheduler scheduler, MemoryPool <byte> pool, FilterPipeline <ITcpSession> filterPipeline)
     : base(socket, options, scheduler, pool, filterPipeline)
 {
     this.readerFlushCallback = this.OnFilterReadFlush;
     this.writerFlushCallback = (writer) => { };
 }