File: udpstream.h

package info (click to toggle)
cubemap 1.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 428 kB
  • sloc: cpp: 4,431; sh: 114; perl: 102; makefile: 60
file content (31 lines) | stat: -rw-r--r-- 788 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef _UDPSTREAM_H
#define _UDPSTREAM_H 1

// A single UDP destination. This is done a lot less efficient than HTTP streaming
// since we expect to have so few of them, which also means things are a lot simpler.
// In particular, we run in the input's thread, so there is no backlog, which means
// that there is no state (UDP itself is, of course, stateless).

#include <arpa/inet.h>
#include <netinet/in.h>
#include <stddef.h>
#include <stdint.h>
#include <sys/types.h>

class MarkPool;

class UDPStream {
public:
	UDPStream(const sockaddr_in6 &dst, uint32_t pacing_rate, int ttl, int multicast_iface_index);
	~UDPStream();

	void send(const char *data, size_t bytes);

private:
	UDPStream(const UDPStream& other);

	sockaddr_in6 dst;
	int sock;
};

#endif  // !defined(_UDPSTREAM_H)