Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to send a quit message with POE::Component::IRC?

1 view
Skip to first unread message

Andy Smith

unread,
Oct 15, 2012, 7:50:34 AM10/15/12
to p...@perl.org
Hi,

I've got a simple IRC bot implemented with POE::Component::IRC and I
decided to add a SIGINT handler to it that gives a useful quit
message.

I couldn't get it to actually send a quit message from the handler,
so I then tried to make it issue a quit message anywhere at all. I
was also unsuccessful in this.

Looking around I found:

http://stackoverflow.com/a/2652671/1394607

Which has some sample code from Hinrik showing how to do such a
handler. Unfortunately this code also does not send a quit message.
It always quits with either no message ("Client Quit") or else
"Remote host closed the connection". That's the exact same problem I
was having.

I'm using the package libpoe-component-irc-perl version 6.78+dfsg-1
on Debian 6.0, but I also got the latest POE::Component::IRC from
CPAN and have the same issue.

So, is this a bug in POE::Component::IRC, or is Hinrik's code sample
there incorrect?

I did also find:

http://search.cpan.org/~bingos/POE-Component-IRC-6.79/lib/POE/Component/IRC/Cookbook/Disconnecting.pod

but was similarly unsuccessful with "shutdown".

Cheers,
Andy

Andy Smith

unread,
Oct 15, 2012, 1:55:20 PM10/15/12
to p...@perl.org
Hello,

On Mon, Oct 15, 2012 at 11:50:34AM +0000, Andy Smith wrote:
> So, is this a bug in POE::Component::IRC, or is Hinrik's code sample
> there incorrect?

..and the answer is neither.

I also sent this to the RT for POE::Component::IRC and Hinrik
replied to that asking if I was doing this on Freenode, as
Freenode's ircd ignores your quit message if you have only been
connected for a short time.

I'm not doing this on Freenode, but it turns out that the ircd of
the network I was doing it on also does this:

https://github.com/atheme/charybdis/blob/master/modules/core/m_quit.c#L75

So, uh, yeah! That was it.

Apologies for the noise.

Cheers,
Andy
0 new messages