| Bot-Net documentation | view source | Contained in the Bot-Net distribution. |
Bot::Net::Server - mixin class for building Bot::Net servers
bin/botnet server --name Main --mixin IRC
This is the main mixin class implemented by all Bot::Net servers. A server may facilitate the communication between bots. In some cases, a server may also simultaneously be a bot too (IRC server bots can be helpful for authentication and channel and nick management, for example).
Custom exporter for this mixin.
This is a helper for POE::Declarative. It prefixes "server_" to the name of your POE states. For example:
on server startup => run { ... };
is the same as:
on server_startup => run { ... };
It can also be used to yield messages:
yield server 'startup'; # probably shouldn't actually do that
You may choose to use it or not.
Setup the server and call all the mixin setup methods.
Returns a base configuration appropriate for all servers.
These are additional states your server (or server mixin) may choose to implement that are provided to your server.
This is yielded at the end of the on _start handler for the POE session. Your server should perform any initialization needed here.
A server should emit this state when it wants the server to disconnect and shutdown. If all mixins are implemented correctly, they should listen for this state and close all resources, which should result in the server going into the on _stop state and exiting shortly after emitting this state. (If they are not, the server might just be stuck alive and have to be killed externally.)
This should be used by protocol mixins to implement the shutdown sequence for their listening ports, open files, etc.
Handles session startup. At startup, it loads the information stored in the configuration file and then fires on server startup.
Performs logging for the general messages that are not handled by the system.
This calls (synchronously) the on server shutdown state, to handle any final clean up before quitting.
Andrew Sterling Hanenkamp <hanenkamp@cpan.org>
Copyright 2007 Boomer Consulting, Inc. All Rights Reserved.
This program is free software and may be modified and distributed under the same terms as Perl itself.
| Bot-Net documentation | view source | Contained in the Bot-Net distribution. |