11 class UDPInput : public Input {
13 UDPInput(const std::string &url);
15 // Serialization/deserialization.
16 UDPInput(const InputProto &serialized);
17 virtual InputProto serialize() const;
19 virtual std::string get_url() const { return url; }
20 virtual void close_socket();
22 virtual void add_destination(int stream_index);
24 virtual InputStats get_stats() const;
27 // Actually gets the packets.
28 virtual void do_work();
30 // Create the HTTP header.
31 void construct_header();
33 std::vector<int> stream_indices;
35 // The URL and its parsed components.
37 std::string host, port, path;
39 // The HTTP header we're sending to clients.
40 std::string http_header;
42 // The socket we are receiving on (or -1).
45 // Temporary buffer, sized for the maximum size of an UDP packet.
46 char packet_buf[65536];
48 // Mutex protecting <stats>.
49 mutable pthread_mutex_t stats_mutex;
51 // The current statistics for this connection. Protected by <stats_mutex>.
55 #endif // !defined(_UDPINPUT_H)