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

  • Home
  • SEARCH
  • 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 3681624
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:42:30+00:00 2026-05-19T03:42:30+00:00

Quoting from this socket tutorial : Sockets come in two primary flavors. An active

  • 0

Quoting from this socket tutorial:

Sockets come in two primary flavors.
An active socket is con­nect­ed to a
remote active socket via an open data
con­nec­tion… A passive socket is
not con­nect­ed, but rather awaits an
in­com­ing con­nec­tion, which will
spawn a new active socket once a
con­nec­tion is es­tab­lished
…

Each port can have a single passive
socket binded to it, await­ing
in­com­ing con­nec­tions, and
mul­ti­ple active sockets, each
cor­re­spond­ing to an open
con­nec­tion on the port. It’s as if
the factory worker is waiting for new
mes­sages to arrive (he rep­re­sents
the passive socket), and when one
message arrives from a new sender, he
ini­ti­ates a cor­re­spon­dence (a
con­nec­tion) with them by
del­e­gat­ing someone else (an active
socket) to ac­tu­al­ly read the packet
and respond back to the sender if
nec­es­sary. This permits the factory
worker to be free to receive new
packets.
…

Then the tutorial explains that, after a connection is established, the active socket continues receiving data until there are no remaining bytes, and then closes the connection.

What I didn’t understand is this: Suppose there’s an incoming connection to the port, and the sender wants to send some little data every 20 minutes. If the active socket closes the connection when there are no remaining bytes, does the sender have to reconnect to the port every time it wants to send data? How do we persist a once established connection for a longer time? Can you tell me what I’m missing here?

My second question is, who determines the limit of the concurrently working active sockets?

  • 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-19T03:42:31+00:00Added an answer on May 19, 2026 at 3:42 am

    The sender should send a KEEPALIVE packet at regular intervals to keep the connection alive. The format of the KEEPALIVE depends on the protocol. It could be as small as a single NULL in the TCP data segment.

    As to the second question… it depends on the I/O. If it is blocking I/O then you only want a certain number of threads running on your computer, so you won’t be able to have many clients. If it’s non-blocking, you can have a lot more clients. Programming languages should have support for both blocking and non-blocking I/O. (I know for a fact that Java does.)

    It also depends on things like bandwidth, the data transfer for each client, memory, clock speed, etc. But non-blocking vs. blocking can make a huge difference in the number of clients you can accept. You probably can’t have more than 5-10 clients blocking without your server crashing… but you can have thousands if you’re not blocking.

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

Sidebar

Related Questions

Quoting from the MSDN Link for ValueType Class In cases where it is necessary
Quoting from the cakephp Book (ver 1.3): Note that only fields of the model
Quoting from the C-std section 6.7.2.1, struct s { int n; double d[]; };
quoting from The C++ Standard Library by N M Jousttis, Section 5.9 #include <
I'm quoting part of an answer which I received for another question of mine
I'm quoting myself on a previous question I asked to further explain: I'm trying
Which style of Ruby string quoting do you favour? Up until now I've always
For some reasons, I would like to do an explicit quoting of a string
For what x is The expression x IS NOT NULL is not equal to
Objective-C doesn't have namespaces, and many (such as CocoaDevCentral's Cocoa Style Guide ) recommend

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.