public TcpSocketClientConfiguration(ISegmentBufferManager bufferManager)
        {
            BufferManager = bufferManager;

            ReceiveBufferSize = 8192;                       // Specifies the total per-socket buffer space reserved for receives. This is unrelated to the maximum message size or the size of a TCP window.
            SendBufferSize    = 8192;                       // Specifies the total per-socket buffer space reserved for sends. This is unrelated to the maximum message size or the size of a TCP window.
            ReceiveTimeout    = TimeSpan.Zero;              // Receive a time-out. This option applies only to synchronous methods; it has no effect on asynchronous methods such as the BeginSend method.
            SendTimeout       = TimeSpan.Zero;              // Send a time-out. This option applies only to synchronous methods; it has no effect on asynchronous methods such as the BeginSend method.
            NoDelay           = true;                       // Disables the Nagle algorithm for send coalescing.
            LingerState       = new LingerOption(false, 0); // The socket will linger for x seconds after Socket.Close is called.
            KeepAlive         = false;                      // Use keep-alives.
            KeepAliveInterval = TimeSpan.FromSeconds(5);    // https://msdn.microsoft.com/en-us/library/system.net.sockets.socketoptionname(v=vs.110).aspx
            ReuseAddress      = false;                      // Allows the socket to be bound to an address that is already in use.

            SslEnabled                    = false;
            SslTargetHost                 = null;
            SslClientCertificates         = new X509CertificateCollection();
            SslEncryptionPolicy           = EncryptionPolicy.RequireEncryption;
            SslEnabledProtocols           = SslProtocols.Ssl3 | SslProtocols.Tls;
            SslCheckCertificateRevocation = false;
            SslPolicyErrorsBypassed       = false;

            ConnectTimeout = TimeSpan.FromSeconds(15);
            FrameBuilder   = new LengthPrefixedFrameBuilder();
        }
        public TcpSocketServerConfiguration(ISegmentBufferManager bufferManager)
        {
            BufferManager = bufferManager;

            ReceiveBufferSize = 8192;
            SendBufferSize    = 8192;
            ReceiveTimeout    = TimeSpan.Zero;
            SendTimeout       = TimeSpan.Zero;
            NoDelay           = true;
            LingerState       = new LingerOption(false, 0);
            KeepAlive         = false;
            KeepAliveInterval = TimeSpan.FromSeconds(5);
            ReuseAddress      = false;

            PendingConnectionBacklog = 200;
            AllowNatTraversal        = true;

            SslEnabled                    = false;
            SslServerCertificate          = null;
            SslEncryptionPolicy           = EncryptionPolicy.RequireEncryption;
            SslEnabledProtocols           = SslProtocols.Ssl3 | SslProtocols.Tls;
            SslClientCertificateRequired  = true;
            SslCheckCertificateRevocation = false;
            SslPolicyErrorsBypassed       = false;

            ConnectTimeout    = TimeSpan.FromSeconds(15);
            FrameBuilder      = new LengthPrefixedFrameBuilder();
            SessionKeyBuilder = new GuidSessionKeyBuilder();
        }
        public TcpSocketSaeaClientConfiguration()
        {
            BufferManager     = new SegmentBufferManager(100, 8192, 1, true);
            ReceiveBufferSize = 8192;
            SendBufferSize    = 8192;
            ReceiveTimeout    = TimeSpan.Zero;
            SendTimeout       = TimeSpan.Zero;
            NoDelay           = true;
            LingerState       = new LingerOption(false, 0); // The socket will linger for x seconds after Socket.Close is called.

            FrameBuilder = new LengthPrefixedFrameBuilder();
        }
        public TcpSocketSaeaClientConfiguration()
        {
            InitialPooledBufferCount = 4;
            ReceiveBufferSize = 8192;
            SendBufferSize = 8192;
            ReceiveTimeout = TimeSpan.Zero;
            SendTimeout = TimeSpan.Zero;
            NoDelay = true;
            LingerState = new LingerOption(false, 0); // The socket will linger for x seconds after Socket.Close is called.

            FrameBuilder = new LengthPrefixedFrameBuilder();
        }
        public TcpSocketSaeaServerConfiguration()
        {
            InitialPooledBufferCount = 100;
            ReceiveBufferSize        = 8192;
            SendBufferSize           = 8192;
            ReceiveTimeout           = TimeSpan.Zero;
            SendTimeout = TimeSpan.Zero;
            NoDelay     = true;
            LingerState = new LingerOption(false, 0); // The socket will linger for x seconds after Socket.Close is called.

            PendingConnectionBacklog = 200;
            AllowNatTraversal        = true;

            FrameBuilder = new LengthPrefixedFrameBuilder();
        }
        public TcpSocketSaeaServerConfiguration()
        {
            InitialPooledBufferCount = 100;
            ReceiveBufferSize = 8192;
            SendBufferSize = 8192;
            ReceiveTimeout = TimeSpan.Zero;
            SendTimeout = TimeSpan.Zero;
            NoDelay = true;
            LingerState = new LingerOption(false, 0); // The socket will linger for x seconds after Socket.Close is called.

            PendingConnectionBacklog = 200;
            AllowNatTraversal = true;

            FrameBuilder = new LengthPrefixedFrameBuilder();
        }
        public TcpSocketSaeaClientConfiguration(ISegmentBufferManager bufferManager)
        {
            BufferManager = bufferManager;

            ReceiveBufferSize = 8192;                       // Specifies the total per-socket buffer space reserved for receives. This is unrelated to the maximum message size or the size of a TCP window.
            SendBufferSize    = 8192;                       // Specifies the total per-socket buffer space reserved for sends. This is unrelated to the maximum message size or the size of a TCP window.
            ReceiveTimeout    = TimeSpan.Zero;              // Receive a time-out. This option applies only to synchronous methods; it has no effect on asynchronous methods such as the BeginSend method.
            SendTimeout       = TimeSpan.Zero;              // Send a time-out. This option applies only to synchronous methods; it has no effect on asynchronous methods such as the BeginSend method.
            NoDelay           = true;                       // Disables the Nagle algorithm for send coalescing.
            LingerState       = new LingerOption(false, 0); // The socket will linger for x seconds after Socket.Close is called.
            KeepAlive         = false;                      // Use keep-alives.
            KeepAliveInterval = TimeSpan.FromSeconds(5);    // https://msdn.microsoft.com/en-us/library/system.net.sockets.socketoptionname(v=vs.110).aspx
            ReuseAddress      = false;                      // Allows the socket to be bound to an address that is already in use.

            FrameBuilder = new LengthPrefixedFrameBuilder();
        }
Esempio n. 8
0
        public TcpSocketSaeaServerConfiguration(ISegmentBufferManager bufferManager)
        {
            BufferManager = bufferManager;

            ReceiveBufferSize = 8192;
            SendBufferSize    = 8192;
            ReceiveTimeout    = TimeSpan.Zero;
            SendTimeout       = TimeSpan.Zero;
            NoDelay           = true;
            LingerState       = new LingerOption(false, 0);
            KeepAlive         = false;
            KeepAliveInterval = TimeSpan.FromSeconds(5);
            ReuseAddress      = false;

            PendingConnectionBacklog = 200;
            AllowNatTraversal        = true;

            FrameBuilder = new LengthPrefixedFrameBuilder();
        }
        public AsyncTcpSocketClientConfiguration()
        {
            InitialPooledBufferCount = 4;
            ReceiveBufferSize = 8192;
            SendBufferSize = 8192;
            ReceiveTimeout = TimeSpan.Zero;
            SendTimeout = TimeSpan.Zero;
            NoDelay = true;
            LingerState = new LingerOption(false, 0); // The socket will linger for x seconds after Socket.Close is called.

            SslEnabled = false;
            SslTargetHost = null;
            SslClientCertificates = new X509CertificateCollection();
            SslEncryptionPolicy = EncryptionPolicy.RequireEncryption;
            SslEnabledProtocols = SslProtocols.Ssl3 | SslProtocols.Tls;
            SslCheckCertificateRevocation = false;
            SslPolicyErrorsBypassed = false;

            ConnectTimeout = TimeSpan.FromSeconds(15);
            FrameBuilder = new LengthPrefixedFrameBuilder();
        }
        public TcpSocketClientConfiguration()
        {
            InitialPooledBufferCount = 4;
            ReceiveBufferSize        = 8192;
            SendBufferSize           = 8192;
            ReceiveTimeout           = TimeSpan.Zero;
            SendTimeout = TimeSpan.Zero;
            NoDelay     = true;
            LingerState = new LingerOption(false, 0); // The socket will linger for x seconds after Socket.Close is called.

            SslEnabled                    = false;
            SslTargetHost                 = null;
            SslClientCertificates         = new X509CertificateCollection();
            SslEncryptionPolicy           = EncryptionPolicy.RequireEncryption;
            SslEnabledProtocols           = SslProtocols.Ssl3 | SslProtocols.Tls;
            SslCheckCertificateRevocation = false;
            SslPolicyErrorsBypassed       = false;

            ConnectTimeout = TimeSpan.FromSeconds(15);
            FrameBuilder   = new LengthPrefixedFrameBuilder();
        }
Esempio n. 11
0
        public AsyncTcpSocketServerConfiguration()
        {
            InitialPooledBufferCount = 100;
            ReceiveBufferSize        = 8192;
            SendBufferSize           = 8192;
            ReceiveTimeout           = TimeSpan.Zero;
            SendTimeout = TimeSpan.Zero;
            NoDelay     = true;
            LingerState = new LingerOption(false, 0); // The socket will linger for x seconds after Socket.Close is called.

            PendingConnectionBacklog = 200;
            AllowNatTraversal        = true;

            SslEnabled                    = false;
            SslServerCertificate          = null;
            SslEncryptionPolicy           = EncryptionPolicy.RequireEncryption;
            SslEnabledProtocols           = SslProtocols.Ssl3 | SslProtocols.Tls;
            SslClientCertificateRequired  = true;
            SslCheckCertificateRevocation = false;
            SslPolicyErrorsBypassed       = false;

            ConnectTimeout = TimeSpan.FromSeconds(15);
            FrameBuilder   = new LengthPrefixedFrameBuilder();
        }
        public TcpSocketServerConfiguration()
        {
            InitialPooledBufferCount = 100;
            ReceiveBufferSize = 8192;
            SendBufferSize = 8192;
            ReceiveTimeout = TimeSpan.Zero;
            SendTimeout = TimeSpan.Zero;
            NoDelay = true;
            LingerState = new LingerOption(false, 0); // The socket will linger for x seconds after Socket.Close is called.

            PendingConnectionBacklog = 200;
            AllowNatTraversal = true;

            SslEnabled = false;
            SslServerCertificate = null;
            SslEncryptionPolicy = EncryptionPolicy.RequireEncryption;
            SslEnabledProtocols = SslProtocols.Ssl3 | SslProtocols.Tls;
            SslClientCertificateRequired = true;
            SslCheckCertificateRevocation = false;
            SslPolicyErrorsBypassed = false;

            ConnectTimeout = TimeSpan.FromSeconds(15);
            FrameBuilder = new LengthPrefixedFrameBuilder();
        }