#include <assert.h>
#include <stdlib.h>
+#include <sys/types.h>
#include "client.h"
+#include "log.h"
#include "server.h"
#include "serverpool.h"
#include "state.pb.h"
+#include "udpstream.h"
#include "util.h"
+struct sockaddr_in6;
+
using namespace std;
ServerPool::ServerPool(int size)
return num_http_streams++;
}
-int ServerPool::add_udpstream(const sockaddr_in6 &dst, MarkPool *mark_pool)
+int ServerPool::add_udpstream(const sockaddr_in6 &dst, int pacing_rate, int ttl, int multicast_iface_index)
{
- udp_streams.push_back(new UDPStream(dst, mark_pool));
+ udp_streams.push_back(new UDPStream(dst, pacing_rate, ttl, multicast_iface_index));
return num_http_streams + udp_streams.size() - 1;
}
}
}
-void ServerPool::add_data(int stream_index, const char *data, size_t bytes)
+void ServerPool::add_data(int stream_index, const char *data, size_t bytes, StreamStartSuitability suitable_for_stream_start)
{
assert(stream_index >= 0 && stream_index < ssize_t(num_http_streams + udp_streams.size()));
// HTTP stream.
for (int i = 0; i < num_servers; ++i) {
- servers[i].add_data_deferred(stream_index, data, bytes);
+ servers[i].add_data_deferred(stream_index, data, bytes, suitable_for_stream_start);
}
}
return ret;
}
-void ServerPool::set_mark_pool(int stream_index, MarkPool *mark_pool)
+void ServerPool::set_pacing_rate(int stream_index, uint32_t pacing_rate)
{
for (int i = 0; i < num_servers; ++i) {
- servers[i].set_mark_pool(stream_index, mark_pool);
+ servers[i].set_pacing_rate(stream_index, pacing_rate);
}
}