class ClientProto;
class CubemapStateProto;
+class Stream;
class StreamProto;
struct Client {
Client(int sock);
// Serialization/deserialization.
- Client(const ClientProto &serialized);
+ Client(const ClientProto &serialized, Stream *stream);
ClientProto serialize() const;
// The file descriptor associated with this socket.
// What stream we're connecting to; parsed from <request>.
// Not relevant for READING_REQUEST.
std::string stream_id;
+ Stream *stream;
// The header we want to send. This is nominally a copy of Stream::header,
// but since that might change on reconnects etc., we keep a local copy here.
// See put_client_to_sleep() and wake_up_all_clients().
std::vector<Client *> sleeping_clients;
+ // Clients that we recently got data for (when they were in
+ // <sleeping_clients>).
+ std::vector<Client *> to_process;
+
// Recover the this pointer, and call do_work().
static void *do_work_thunk(void *arg);