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 9055339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:55:56+00:00 2026-06-16T13:55:56+00:00

I am trying to build an application that sends and receives responses from a

  • 0

I am trying to build an application that sends and receives responses from a website.

None of the solutions I’ve read on Stack Overflow have solved my problem, so I think that my code could use optimization.

I have the following thread:

void DomainThreadNamecheapStart()
{
    while (stop == false)
    {
        foreach (string FromDomainList in DomainList.Lines)
        {
            if (FromDomainList.Length > 1)
            {
                // I removed my api parameters from the string
                string namecheapapi = "https://api.namecheap.com/foo" + FromDomainList + "bar";

                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(namecheapapi);
                request.Proxy = null;
                request.ServicePoint.Expect100Continue = false;

                HttpWebResponse response = (HttpWebResponse)request.GetResponse();
                StreamReader sr = new StreamReader(response.GetResponseStream());

                status.Text = FromDomainList + "\n" + sr.ReadToEnd();

                sr.Close();
            }
        }
    }
}

This thread is called when a button is clicked:

private void button2_Click(object sender, EventArgs e)
{
    stop = false;
    Thread DomainThread = new Thread(new ThreadStart(DomainThreadNamecheapStart));
    DomainThread.Start();
}

I only receive around 12 responses in 10 seconds using the above code. When I try to make the same request in JavaScript or using a simple IFrame, it’s more than twice as fast. The Browser doesn’t use multiple threads for the connection, it waits until one is finished and then starts the new one.

I tried setting request.Proxy = null;, but it had negligible impact.

I have noticed that HTTPS is 2-3 times slower than HTTP. Unfortunately, I have to use HTTPS. Is there anything I can do to make it faster?

  • 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-06-16T13:55:57+00:00Added an answer on June 16, 2026 at 1:55 pm

    My bet would be on the aspect you pointed out – the HTTPS protocol.

    The iteration between Client(browser) and Server for pure HTTP protocol is quite straightforward: Ask for the info, get info. If 1.0, close connection; if 1.1, it may stay alive for reuse. (Check image 1 for details.)

    But when you do a HTTPS request, the initial protocol overhead is considerable (image 2); but, once the initial negotiation is done, some symmetric encryption takes place, and no further certificate negotiation is necessary, thus speeding up data transfer.

    What I think the problem is, if you destroy the HTTPWebRequest object and creates a new one, the full HTTPS exchange takes place once again, slowing your iteration. (HTTPS + HTTP 1.1 Keepalive should do fine, though.)

    So, suggestions: Switch to HTTP only, or reuse the connection objects.

    And i hope it works for you. =)

    (1) HTTP protocol handshake and response
    HTTP protocol handshake and response

    (2) Initial HTTPS protocol handshake
    enter image description here

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

Sidebar

Related Questions

as titled, am trying to build a small application that will aggregate RSS from
I have an application that I'm trying to build with at least a nominally
I'm trying to build a simple GAE application that would read a textbox, pass
I do have a java server. I am trying to build IPhone application that
I have a small email application that lets a user build a message from
I'm trying to build application that could help me dial a contact just like
I'm trying to build an application that builds a resource file into a jar,
I'm trying to build a application that has different kinds of users, I'm using
i'm trying to build an application that every given time, will connect to a
I am trying to build a Python application that connects to Oracle database and

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.