12 class UDPInput : public Input {
14 UDPInput(const std::string &url);
16 // Serialization/deserialization.
17 UDPInput(const InputProto &serialized);
18 virtual InputProto serialize() const;
20 virtual std::string get_url() const { return url; }
21 virtual void close_socket();
23 virtual void add_destination(int stream_index);
25 virtual InputStats get_stats() const;
28 // Actually gets the packets.
29 virtual void do_work();
31 // Create the HTTP header.
32 void construct_header();
34 std::vector<int> stream_indices;
36 // The URL and its parsed components.
38 std::string user, host, port, path;
40 // The HTTP header we're sending to clients.
41 std::string http_header;
43 // The socket we are receiving on (or -1).
46 // Temporary buffer, sized for the maximum size of an UDP packet.
47 char packet_buf[65536];
49 // Mutex protecting <stats>.
50 mutable std::mutex stats_mutex;
52 // The current statistics for this connection. Protected by <stats_mutex>.
56 #endif // !defined(_UDPINPUT_H)