title: Passive and active sockets
body: <p>Quoting from <a href="http://www.freesoft.org/CIE/Course/Section4/6.htm">this socket tutorial</a>:</p>
  
  <blockquote>
    <p>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
    ...</p>
    
    <p>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.
    ...</p>
  </blockquote>
  
  <p>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.</p>
  
  <p>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?</p>
  
  <p>My second question is, who determines the limit of the concurrently working active sockets? </p>