Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 42 lines (33 sloc) 0.706 kb
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 32 33 34 35 36 37 38 39 40 41
#include <sys/select.h>
#include <vector>

#include "util/thread.hpp"

namespace rubinius {
  class SharedState;

  class QueryAgent : public thread::Thread {
    SharedState& shared_;
    int port_;
    int server_fd_;
    bool verbose_;
    fd_set fds_;
    int max_fd_;

    std::vector<int> sockets_;

    const static int cBackLog = 10;

  public:
    QueryAgent(SharedState& shared, int port)
      : Thread()
      , shared_(shared)
      , port_(port)
      , server_fd_(0)
      , verbose_(false)
      , max_fd_(0)
    {
      FD_ZERO(&fds_);
    }

    void set_verbose() {
      verbose_ = true;
    }

    bool bind();
    virtual void perform();
    bool process_commands(int client);
  };
}
Something went wrong with that request. Please try again.