Subject: | mq.pl (POE::Component::MessageQueue) doesn't exit if the STOMP server port is already in use. |
Date: | Mon, 9 Feb 2009 09:25:34 -0800 |
To: | bug-POE-Component-MessageQueue [...] rt.cpan.org |
From: | ashleyb <ashleyb.moniker [...] gmail.com> |
- Bug in version: POE::Component::MessageQueue version 0.2.5
- how to recreate: start two mq.pl servers on the default port... the
second one will not exit properly if bind fails.
Following is a patch for this, also, you may want to review this
comment in light of this:
POE::Component::Server::Stomp : 89: " #
POE::Component::Server::TCP does it ! So, I do it too."
*** /usr/local/share/perl/5.8.8/POE/Component/MessageQueue.pm
2009-02-09 09:16:20.000000000 -0800
--- /tmp/MessageQueue.pm 2009-02-09 09:16:12.000000000 -0800
***************
*** 170,175 ****
--- 170,176 ----
HandleFrame => sub { $self->_handle_frame(@_) },
ClientDisconnected => sub { $self-
Show quoted text
>_client_disconnected(@_) },
ClientError => sub { $self->_client_error(@_) },
+ Error => sub { $self->_server_error(@_) },
);
# a custom session for non-STOMP responsive tasks
***************
*** 254,259 ****
--- 255,270 ----
}
}
+ sub _server_error
+ {
+ my $self = shift;
+ my ($kernel, $name, $number, $message) = @_[ KERNEL, ARG0,
ARG1, ARG2 ];
+
+ $self->log(error => "STOMP Server error: $name ($number)
'$message'" );
+ print "STOMP Server error: $name ($number) '$message'\n";
+ exit;
+ }
+
sub _shutdown_complete
{
my ($self) = @_;