+void on_connection_opened(const string& host, const Connection::Port& port) {
+ cout << "Se abrió una nueva conexión a " << host << ":" << port << "."
+ << endl;
+}
+
+void on_signal(int signal) {
+ static bool called = false;
+ if (!called) {
+ cout << "Se recibe señal " << signal << "." << endl;
+ }
+ switch (signal) {
+ case SIGINT:
+ case SIGTERM:
+ case SIGQUIT:
+ if (!called && server) {
+ cout << "Terminando servidor... " << flush;
+ server->finish();
+ }
+ break;
+ }
+ called = true;
+}
+