1 // Copyright (C) 2008 Ole Laursen
2 // Copyright (C) 2008 Ben Asselstine
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 3 of the License, or
7 // (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Library General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 #ifndef NETWORK_SERVER_H
20 #define NETWORK_SERVER_H
25 #include <sigc++/signal.h>
28 #include "network-common.h"
32 class NetworkConnection;
41 void startListening(int port);
42 void send(void *conn, MessageType type, const std::string &payload);
44 sigc::signal<void, void *, MessageType, std::string> got_message;
45 sigc::signal<void, void *> connection_made;
46 sigc::signal<void, void *> connection_lost;
49 void gotClientConnection(_GConn* conn);
52 void onConnectionLost(NetworkConnection *conn);
55 std::list<NetworkConnection *> connections;