Please don't modify your original code that much, as people then can't learn from seeing your code progress through the stages.
The next step would be to add (much) more amounts of server-side logging. print or warn at every step of the process. At least add logging statements to the following points:
mount '/echo' => SockJS->new( handler => sub { warn "Creating new session"; my ($session) = @_; $session->on( 'data' => sub { my $session = shift; warn "got new data"; $session->write('got your message'); warn "Wrote response"; } ); $session->write('connected'); warn "Wrote greeting"; my $w_cond = AnyEvent->condvar; my $w; $w = AnyEvent->timer( after => 0, interval => 5, cb => sub { undef $w; # cleanup $session->write('5 seconds have passed'); warn "Wrote timer message"; $w_cond->send(); } ); $w_cond->recv; warn "Leaving"; }; );
In reply to Re^3: PSGI, Plack, Twiggy, AnyEvent and SockJS... I need help
by Corion
in thread PSGI, Plack, Twiggy, AnyEvent and SockJS... I need help
by xtpu2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |