Example #1
0
        public ZmqSocketOptions()
        {
            SendHighWaterMark = 20000;
            SendTimeout       = 100.Milliseconds();
            SendRetriesBeforeSwitchingToClosedState = 2;

            ClosedStateDurationAfterSendFailure    = 15.Seconds();
            ClosedStateDurationAfterConnectFailure = 2.Minutes();

            ReceiveHighWaterMark = 40000;
            ReceiveTimeout       = 300.Milliseconds();

            KeepAlive = KeepAliveOptions.On(30.Seconds(), 3.Seconds());
        }
Example #2
0
            protected override void ProcessHeaders(WebHeaderCollection headers)
            {
                string value;

                value = headers["connection"];
                if (value != null && value.Equals("keep-alive", StringComparison.OrdinalIgnoreCase))
                {
                    value = headers["keep-alive"];

                    KeepAliveOptions keepAlive = new KeepAliveOptions();
                    keepAlive.keepAlive = true;

                    if (value != null)
                    {
                        int i, j;

                        i = value.IndexOf("max=", StringComparison.OrdinalIgnoreCase);
                        if (i != -1)
                        {
                            i += 4;
                            j  = value.IndexOf(',', i);
                            if (j == -1)
                            {
                                j = value.Length;
                            }

                            Int32.TryParse(value.Substring(i, j - i), out keepAlive.max);
                        }

                        i = value.IndexOf("timeout=", StringComparison.OrdinalIgnoreCase);
                        if (i != -1)
                        {
                            i += 8;
                            j  = value.IndexOf(',', i);
                            if (j == -1)
                            {
                                j = value.Length;
                            }

                            Int32.TryParse(value.Substring(i, j - i), out keepAlive.timeout);
                        }
                    }

                    this.KeepAlive = keepAlive;
                }
            }
Example #3
0
 internal protected virtual void KeepAlive(bool keepAlive = true, int interval = 5000, int span = 1000)
 {
     KeepAliveOption = new KeepAliveOptions(keepAlive, interval, span);
 }
Example #4
0
 public virtual void UseKeepAlive(bool keepAlive = true, int interval = 5000, int span = 1000)
 {
     KeepAliveOption = new KeepAliveOptions(keepAlive, interval, span);
 }