in reply to Net::Async::WebSocket::Server in a separate main loop

Hi all,

thanks for the answers. I finally ended up in doing the following:

Create socket:

my $sslSocket = IO::Socket::SSL->new( Listen => 5, LocalPort => XXXX, Proto => 'tcp', SSL_server => 1, SSL_startHandshake => 1, SSL_cert_file => 'CRT', SSL_key_file => 'KEY', ReuseAddr => 1, Blocking => 0 );

Create Websocket Server via Async Lib:

my $server = Net::Async::WebSocket::Server->new( ... );

Create Async Loop and add server to that loop:

my $loop = IO::Async::Loop->new; $loop->add( $server ); $server->listen( handle => $sslSocket )->get;

In the main loop watching the socket for new clients, connect clients, watch their socket and if data for reading is there:

while($loop->loop_once(0.0001) > 0) { };

The "loop_once" call basically acts as long as there is "something to do", but exists eventually. With that concept my requirement works pretty well.

Bye