On Wed, Feb 13, 2013 at 03:38:26PM +0800, Michael Fung <[email protected]> wrote:
> I want to run a tcp server with forked children to handle thousands
> of concurrent clients. The code is working okay in plain text.
> However, when I switch on SSL support:
I can hardly say anything specific without an actual example - too much might
go wrong in code that you have omitted.
First, you really need to make sure you (and neither anybody else) creates
any watchers before forking. The easiest method to ensure this is to use
fork+exec instead of fork and inherit. Likewise, make sure nothing creates
any threads before forking either (just loading AnyEvent::IO can do that).
Lastly, do you have Net::SSLeay installed?
> my $handles->{$client_id} = new AnyEvent::Handle(
Do you store the handle anywhere for longer? If you don't store the
handle anywhere else, it will immediately get destroyed at the end of the
enclosing block.
> Any hints are welcome.
Apart from these general remarks, you could start playing around with
t/80_ssltest.t, which should be able to successfully create an ssl
connection, and change it into your model to see at which change it stops
working.
--
The choice of a Deliantra, the free code+content MORPG
-----==- _GNU_ http://www.deliantra.net
----==-- _ generation
---==---(_)__ __ ____ __ Marc Lehmann
--==---/ / _ \/ // /\ \/ / [email protected]
-=====/_/_//_/\_,_/ /_/\_\
_______________________________________________
anyevent mailing list
[email protected]
http://lists.schmorp.de/mailman/listinfo/anyevent