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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:36:44+00:00 2026-05-15T04:36:44+00:00

I’m trying to establish a HTTP persistent connection from a Silverlight application to a

  • 0

I’m trying to establish a HTTP persistent connection from a Silverlight application to a PHP page (ie without creating a new TCP connection for each HTTP request) hosted by an Apache server.

To this end, I need the webserver to send its HTTP responses with the “Connection” header set to “Keep-alive”. Client-side, there doesn’t seem to be any issue as the network API provided by Silverlight is basically a wrapper of the browser network capabilies, from what I’ve read : so if the browser supports HTTP 1.1 and Connection: Keep-Alive by default for its requests, it’s fine. Content-Length is also well defined, so that the server knows when
it has to send the response. However, the server response to the PHP request sets systematically “Connection:” to “close”, thus ending the connection and preventing a persistent connection.

I’ve tried some things to work around this problem : different Methods (GET and POST), explicitly giving a “Connection: keep-alive” to the response with the following PHP code at the beginning of my script :

header("Connection: Keep-alive");

The latter adds the expected header to the response, which is good, but an additionnal “Connection: close” is still appended later in the response headers.

Is it a feature of PHP or Apache which enforces “close” (for some security or performance purpose, I’m guessing) or am I just missing something here ?

Thanks in advance.

P.S. : By sniffing packets, I’ve noticed that not many websites use “Keep-alive” and the TCP connection is reestablished. Isn’t Keepalive the default and preferred behavior under HTTP 1.1 ?

  • 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-15T04:36:45+00:00Added an answer on May 15, 2026 at 4:36 am

    The Keep-Alive functionality is not meant for persistent connections.

    Keep-Alive is meant to reduce the number of connections for a website. Instead of creating a new connection for each image/css/javascript in a webpage many requests will be made re-using the same connection.

    There are some settings that prevent this in Apache too, like maximum number of requests on a connection or timeouts between requests. This will also eat your resources very fast because every connection needs its own thread.

    You should switch to another solution, that is made for that kind of work.

    For services that keep your connection open you can take a look at http://orbited.org and http://twistedmatrix.com/trac/

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

Sidebar

Ask A Question

Stats

  • Questions 434k
  • Answers 434k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I've tried your xml file exactly and it works for… May 15, 2026 at 3:16 pm
  • Editorial Team
    Editorial Team added an answer If you wanted this simpler approach generalize it so you… May 15, 2026 at 3:16 pm
  • Editorial Team
    Editorial Team added an answer You are associating the click event with every instance of… May 15, 2026 at 3:16 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.