GetReuseCount() public method

public GetReuseCount ( int requestId ) : int
requestId int
return int
示例#1
0
        void AddConnectionHeader()
        {
            if (!keepAlive)
            {
                responseHeaders.Append("Connection: close\r\n");
                return;
            }

            int allowed = requestBroker.GetReuseCount(requestId);

            if (allowed <= 0)
            {
                keepAlive = false;
                responseHeaders.Append("Connection: close\r\n");
                return;
            }

            responseHeaders.Append("Keep-Alive: timeout=15, max=");
            responseHeaders.Append(allowed.ToString());
            responseHeaders.Append("\r\n");
            responseHeaders.Append("Connection: Keep-Alive\r\n");
        }