HTTPConnectionManager.h 2.16 KB
Newer Older
Christopher Mueller's avatar
Christopher Mueller committed
1
2
3
4
5
6
7
8
9
/*
 * HTTPConnectionManager.h
 *****************************************************************************
 * Copyright (C) 2010 - 2011 Klagenfurt University
 *
 * Created on: Aug 10, 2010
 * Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
 *          Christian Timmerer  <christian.timmerer@itec.uni-klu.ac.at>
 *
10
11
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published
Christopher Mueller's avatar
Christopher Mueller committed
12
13
14
15
16
 * by the Free Software Foundation; either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
Christopher Mueller's avatar
Christopher Mueller committed
19
20
 *
 * You should have received a copy of the GNU Lesser General Public License
21
22
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
Christopher Mueller's avatar
Christopher Mueller committed
23
24
25
26
27
 *****************************************************************************/

#ifndef HTTPCONNECTIONMANAGER_H_
#define HTTPCONNECTIONMANAGER_H_

28
29
30
31
32
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#include "http/PersistentConnection.h"
33
#include "adaptationlogic/IDownloadRateObserver.h"
34

Christopher Mueller's avatar
Christopher Mueller committed
35
36
37
38
39
40
41
42
43
44
#include <vlc_common.h>
#include <vector>

namespace dash
{
    namespace http
    {
        class HTTPConnectionManager
        {
            public:
45
                HTTPConnectionManager           (stream_t *stream);
Christopher Mueller's avatar
Christopher Mueller committed
46
47
                virtual ~HTTPConnectionManager  ();

48
                void    closeAllConnections ();
49
                void    releaseAllConnections ();
50
                bool    connectChunk        (Chunk *chunk);
51

52
            private:
53
                std::vector<PersistentConnection *>                 connectionPool;
Christopher Mueller's avatar
Christopher Mueller committed
54
55
                stream_t                                            *stream;

56
57
                static const uint64_t   CHUNKDEFAULTBITRATE;

58
                PersistentConnection *                  getConnectionForHost    (const std::string &hostname);
Christopher Mueller's avatar
Christopher Mueller committed
59
60
61
62
63
        };
    }
}

#endif /* HTTPCONNECTIONMANAGER_H_ */