1 /***************************************************************************
3 * Copyright (C) 2006 David Brodsky *
5 * This program is free software; you can redistribute it and/or *
6 * modify it under the terms of the GNU General Public License as *
7 * published by the Free Software Foundation and appearing *
8 * in the file LICENSE.GPL included in the packaging of this file. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
13 * General Public License for more details. *
15 ***************************************************************************/
17 #ifndef _main_torrentserver_h
18 #define _main_torrentserver_h
32 }; // namespace Tairon
42 /** \brief Server accepting incomming connections for torrents.
47 /** Starts the server on port specified by config key
48 * "torrent-server-port".
52 /** Destroys the server.
56 /** Tells the server that a handshake sequence has been successfuly
59 void connectionCompleted(Connection
*connection
);
61 /** Returns pointer to the instance of this class.
63 static TorrentServer
*self() {
72 /** Called when a pending connection has been closed.
74 void connectionClosed(Connection
*connection
);
76 /** Called when a new connection arrives.
78 void newConnection(Tairon::Net::Server
*, int fd
);
81 /** Set of connections that aren't fully established yet.
83 std::set
<Connection
*> pendingConnections
;
85 /** Server object for accepting incoming connections.
87 Tairon::Net::Server
*server
;
89 /** Pointer to the instance of this class.
91 static TorrentServer
*torrentserver
;
96 }; // namespace Tairent
100 // vim: ai sw=4 ts=4 noet fdm=marker