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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:07:39+00:00 2026-05-31T02:07:39+00:00

I have a program in C++ using winsock that connects to a server, the

  • 0

I have a program in C++ using winsock that connects to a server, the user’s will need to send data to this server periodically over a very long span of time(perhaps weeks without the need to reconnect).

I have found plenty of documentation on timeouts when establishing a connection, but I am trying to find out how long the connection lasts after it has been established. Does the connection last until either program is shut down? Can I connect then wait two hours to send something?

  • 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-31T02:07:40+00:00Added an answer on May 31, 2026 at 2:07 am

    There’s no explicit connection lifetime limitation (at least in TCP). The connection lasts until one of the following:

    • Either endpoint (application) shuts down (actually the connection may remain in half-duplex mode)
    • Intermediate entity decides to terminate the connection (such as firewall, NAT or etc.)

    In “real-world” internet connections are usually shut down forcibly after some period of time, especially if there’s no data sent. Besides of this, depending on the protocol, some servers refuse to keep the connection open for indefinite time (such as http servers).

    In conclusion: there’s no generic way to discover the lifetime of the connection. You’re completely in the hands of the firewalls, proxies (if applicable), and the server behalf.

    Sending some data periodically (such as keep-alive messages) usually help. It also helps to detect that the connection has been silently terminated.

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

Sidebar

Related Questions

I have a program that creates a Windows user account using the NetUserAdd() API
I have a program to send POST request to a server. I'm using cURL
I have a C++ program using OpenMP, which will run on several machines that
I have a program that does some networking using Winsock, and one of our
I have a program that's using adt / abstract data classes with data structures.
I have a program that draws some vector graphics using System.Drawing and the Graphics
I have a program that monitors debug messages and I have tried using a
I have a program that loads an image from a file with DirectX using
I have this program in c++: #include <iostream> using namespace std; int main() {
I have finished a program using sql server and visual studio using c# language

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.