Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: Multiplexing HTTPS server, peer cert authentication problem.

by Moron (Curate)
on Mar 06, 2007 at 10:40 UTC ( [id://603377]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Multiplexing HTTPS server, peer cert authentication problem.
in thread Multiplexing HTTPS server, peer cert authentication problem.

If you are sticking with threads, you can pass objects to threads using the Thread::Queue module. In fact that is also the recommended (big Camel book) way to synchronise the handling of asynchronous requests under those circumstances, although if you use it to meet both requirements you'd need N+1 queues where N is the number of startup threads - one to synchronise requests to the request-handling synchronous daemon and one for each startup daemonet to receive object data from the initialising parent.

And if the threads approach remains too troublesome, you could always spawn the daemonets with something like for (1..$nrDmnts) { my $pid = open my $ph, "|-" ... } instead and send them non-shared data across the pipe.

-M

Free your mind

  • Comment on Re^3: Multiplexing HTTPS server, peer cert authentication problem.

Replies are listed 'Best First'.
Re^4: Multiplexing HTTPS server, peer cert authentication problem.
by erroneousBollock (Curate) on Mar 06, 2007 at 12:18 UTC
    In my real server, I *am* actually using Thread::Queue::Any to farm out work to my worker threads from my multiplexing server.

    The code I posted is my (boilded down for SoPW) attempt at making my *mostly* non-blocking server *fully* non-blocking. (I see from Thelonius's suggestion that I may not have finished the job). The real server replaces the "file" code from the OP with a mechanism to send work to a Dispatcher thread which classifies the request, finds an appropriate handler class then farms the "work" out to a pool of worker threads.

    I can't actually import Threads.pm into the multiplexing server's package as some "magic" internal to Threads.pm causes crashes in IO::Socket::SSL (actually XS from Net::SSLeay).

    As for the excellently old-skool open "|blah" method of IPC, i would use it in a second (over say Thread::Queue::Any) if there was currently any problem with the IPC -- I do not believe this to be the case.

    -David.
      I am suggesting repairing the SSL data by sending it across from a parent process. The open "|blah" suggestion is a last resort option to prevent the need for Threads, not because there are any problems with IPC.

      -M

      Free your mind

        I still don't understand ;) I'm not very smart.

        In the OP, there is no use of threads. It's a single-threaded multiplexing server... works/fails the same on Windows with threads or Linux without.

        I guess I'm not effectively describing my problem; that the peer certificate authentication is screwing up.

        I don't know if the solution is to somehow go back to a more reliable 'blocking' server, or to somehow fix the multiplexing server from the OP.

        -David.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://603377]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-25 12:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found