Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6577039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:35:09+00:00 2026-05-25T15:35:09+00:00

How can i do in C#/Windows7 , that my app do not reuse existing

  • 0

How can i do in C#/Windows7 , that my app do not reuse existing SSL conenction. Actually when i make a get request with HttpWebRequest to a https page if there is an existing conenction then it use this connection (= same ssl-sessionid). I have done some test and windows 7 renegotiate the ssl connection after 2 minutes . But i will that it never reuse existing connection.

i have tried a lot of things:
keep-alive, ClientCacheTime (regedit), ServicePointManager.SetTcpKeepAlive …

Thanks very much !

            ServicePointManager.Expect100Continue = true;
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
            ServicePointManager.DnsRefreshTimeout = 200;
           /* ServicePointManager.SetTcpKeepAlive(false,0,0);
            ServicePointManager.DefaultConnectionLimit = 100;
            ServicePointManager.MaxServicePointIdleTime = 1;*/
        //    ServicePointManager.DefaultConnectionLimit = 1;
            uri = "https://server.com/test.jsp";

            HttpWebRequest request = (HttpWebRequest)
          WebRequest.Create(uri);
            request.UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)";
            request.CookieContainer = cookieJar;
            request.ContentType = "text/xml";// content type

            request.KeepAlive = false;
            request.ProtocolVersion = HttpVersion.Version11;
            request.Method = "GET";
            request.ConnectionGroupName = "dsd" + i;
           // request.ReadWriteTimeout = 2000;
           /* request.Timeout = 5000;
            request.UseDefaultCredentials = false;
            request.CachePolicy = new RequestCachePolicy(RequestCacheLevel.NoCacheNoStore);
            request.ConnectionGroupName = DateTime.Now.Ticks.ToString(); */
           // X509Certificate2 cert = new X509Certificate2("C:\\a.crt", "abcd");
           X509Certificate2 cert = new X509Certificate2();
            request.ClientCertificates.Add(cert);
           /* request.PreAuthenticate = false;
            request.Pipelined = true;*/


            WebResponse rsp = request.GetResponse();
            string PageContent = new StreamReader(rsp.GetResponseStream()).ReadToEnd();


            textBox1.Text = PageContent;
            request.ServicePoint.CloseConnectionGroup("dsd" + i);
            request.Abort();

            request.ClientCertificates.Clear();
            rsp.GetResponseStream().Close();
            rsp.Close();
            request.Abort();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:35:10+00:00Added an answer on May 25, 2026 at 3:35 pm

    Since you don’t provide much detail just some general pointers:

    • set ServicePointManager.DnsRefreshTimeout to a very low value (default is 2 minutes = 120000 ms)
    • set HttpWebRequest.ConnectionGroupName to a unique value on EVERY request
    • call HttpWebRequest.ServicePoint.CloseConnectionGroup with that value AFTER EVERY request
    • call HttpWebRequest.Abort AFTER EVERY request

    The above might work unreliably – depending on OS version and Framework version…

    I am curious: achieving this means you have alot less performance… what is the goal ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to deveplop an app for Windows Mobile 5.0 and above that can
I'm trying to make a Windows app that checks some things in the background,
I have an AIR/Flex app that can have multiple windows (s:Window instances) open at
I noticed that I can add a reference not only to a DLL but
I'd like to create an app that I can dock to my screen such
Are there any tools/libraries on Windows that can help me tarck down the culprit?
Does anybody know where I can find a utility/application running on Windows that analyses
I heard that on Windows you can login from a web browser to the
I have a C++ Windows application that can be extended by writing C++ plugins,
How can you combine two windows in Screen? I have two windows such that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.