Your problem is very similar to the problems with a Web frontend to the IMAP protocol; it is designed to be stateful and let users keep connections, which conflicts with HTTP's stateless model.

A solution that some IMAP users use is a connection-caching IMAP proxy. It keeps a large cache of connections open, each identified somehow (with an ID or by username/password). When the Web app gets a request, it opens a new connection to the IMAP proxy. The proxy looks in its connection cache for the connection. If it finds it, it uses the cached connection; otherwise it opens a new one. Presumably the proxy will time out connections after a period of time, or else keep a maximum number of sessions open then close the least recently used one.

You could do this by adding a SESSION command to your protocol, which the proxy could use to re-attach users to sessions. The session number could be kept as a cookie, form variable, session variable, etc.


In reply to Re: HTTP server guidance by sgifford
in thread HTTP server guidance by DaveH

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.