]> git.sesse.net Git - cubemap/blobdiff - serverpool.h
Set close-on-exec on all file descriptors we open.
[cubemap] / serverpool.h
index a70d5429221af06f82049e8c098d93e52c33cbc9..253636a64c1de876b83fa051a97a1a12ff81cece 100644 (file)
@@ -29,6 +29,9 @@ public:
        void add_client(int sock, Acceptor *acceptor);
        void add_client_from_serialized(const ClientProto &client, const std::vector<std::shared_ptr<const std::string>> &short_responses);
 
+       // Picks a srever (round-robin) and adds the given HLS zombie to it.
+       void add_hls_zombie_from_serialized(const HLSZombieProto &client);
+
        // Adds the given stream to all the servers. Returns the stream index.
        int add_stream(const std::string &url,
                       const std::string &hls_url,
@@ -52,6 +55,9 @@ public:
                        const std::string &stream_header);
        void add_data(int stream_index, const char *data, size_t bytes, uint16_t metacube_flags, const RationalPTS &pts);
 
+       // Sets the given stream as unavailable on all the servers.
+       void set_unavailable(int stream_index);
+
        // Sets the max pacing rate for all the servers.
        void set_pacing_rate(int stream_index, uint32_t pacing_rate);
 
@@ -95,6 +101,7 @@ public:
        void stop();
 
        std::vector<ClientStats> get_client_stats() const;
+       std::vector<HLSZombie> get_hls_zombies() const;
 
 private:
        std::unique_ptr<Server[]> servers;