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 _httptracker_client_client_h
18 #define _httptracker_client_client_h
20 #include "main/trackerclient.h"
33 }; // namespace Tairon
38 namespace TrackerClient
41 /** \brief Tracker client for http protocol.
43 class HTTPTrackerClient
: public Tairent::Main::TrackerClient
46 /** Creates a tracker client object.
48 * \param c Torrent that uses this tracker.
50 HTTPTrackerClient(Tairent::Main::TorrentClient
*c
);
52 /** Destroys the object.
54 virtual ~HTTPTrackerClient();
56 /** Gets peers from the tracker and passes it to the client.
58 virtual void getPeers();
60 /** Sends to the tracker that this client is no longer available.
65 /** Called when there are data available from the tracker.
67 void dataRead(Tairon::Net::HTTPClient
*);
69 /** Called when an error occurs.
71 void error(Tairon::Net::HTTPClient
*, const char *msg
, int err
);
73 /** Called when an error occurs during stopping.
75 void errorWhileStopping(Tairon::Net::HTTPClient
*, const char *, int);
77 /** Called when the client is stopped.
79 void stopped(Tairon::Net::HTTPClient
*);
81 /** Called when an interval timeout occurs.
86 /** HTTP client used to get data from the tracker.
88 Tairon::Net::HTTPClient
*httpclient
;
90 /** Timer used for rerequests.
92 Tairon::Net::Timer
*timer
;
94 /** URI of the tracker.
99 }; // namespace TrackerClient
101 }; // namespace HTTPTrackerClienti
105 // vim: ai sw=4 ts=4 noet fdm=marker