Your first server only has the problem that it is missing new accepts while being busy but it still has to complete authentication before you serve the request, which is more likely to be the source of the blocking than local servicing of requests alone. The code posted in the OP attempts to force everything into a synchronous handling. But of course the authentication is not part of your synchronous handling and your attempted solution is certainly breaking it - but I think this probably isn't just a code-fixing issue but more likely a question of writing code that is asynchronous (so cannot be single-threaded) where it needs to be i.e. that respects the asynchronous nature of the requests and authentications occurring at a lower layer than you have control over when using the modules you have selected.

I'd be inclined instead to conform as closely as possible to the examples shown in Chapter 16 of Programming Perl, which covers everything discussed so far, except that your processing is synchronous and Chapter 16 (when the relevant sections are considered together - they are of course split up for more general purposes than just yours) appears to me to advocate an asynchronous multi-threaded approach.

And re Thread::Queue, you said you already did that in the first solution. And yet you say now that solution was ALSO single-threaded? I think you are missing the point of that module.

-M

Free your mind


In reply to Re^9: Multiplexing HTTPS server, peer cert authentication problem. by Moron
in thread Multiplexing HTTPS server, peer cert authentication problem. by erroneousBollock

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.