Subject: | POE::Component::Client::Bayeux fault tolerance? |
Date: | Tue, 27 Oct 2009 16:56:19 +0000 |
To: | "bug-POE-Component-Server-Bayeux [...] rt.cpan.org" <bug-POE-Component-Server-Bayeux [...] rt.cpan.org> |
From: | Martin King <Martin.King [...] arm.com> |
It seems you can't trap any connection errors with this component. If the server isn't listening, the POE::Kernel->run() in the client crashes. The code is trying to parse an HTML error message when it's expecting a JSON string.
bash-3.1$ perl ./BayeuxClient.pl
Failed to JSON decode data (error malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "<html>\n<HEAD><TITLE...") at /arm/tools/perl/perl/5.8.8/common/lib/site_perl/5.8.8/JSON/Any.pm line 481.
). Content:
<html>
<HEAD><TITLE>Error: Internal Server Error</TITLE></HEAD>
<BODY>
<H1>Error: Internal Server Error</H1>
Cannot connect to 127.0.0.1:80 (connect error 111: Connection refused)
<small>This is a client error, not a server error.</small>
</BODY>
</HTML>
This is using your example from the perldoc.
Specifying an 'ErrorCallback' doesn't work. Neither does trying to trap the kernel 'DIE' signal.
Of course, I could have missed something. I'm new to this POE malarky.
Regards,
Martin King
-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.