5 #include <TServerSocket.h>
30 , m_n_sp_sel_max(2000)
64 if (find(m_list_sp.begin(), m_list_sp.end(), id) == m_list_sp.end()) m_list_sp.push_back(
id);
69 if (m_list_sp.size() == 0) {
72 sort(m_list_sp.begin(), m_list_sp.end());
73 id_min = m_list_sp[0];
74 id_max = m_list_sp[m_list_sp.size()-1];
87 if (mess && mess->What() == kMESS_STRING) {
89 mess->ReadString(str, 200);
90 istringstream iss(str);
91 if (! (iss >> m_sp_min >> m_sp_max >> m_sp_sel)) {
92 m_sp_min = m_sp_max = 0;
119 for (
int ip = 0; ip < n_port; ip++) {
120 bool port_ok =
false;
121 sock =
new TSocket(host.c_str(), port);
122 if (sock->IsValid()) {
124 if (sock->Select(TSocket::kRead, 2000) > 0) {
127 if (mess && mess->What() == kMESS_STRING) {
129 mess->ReadString(str, 200);
130 if (strcmp(str,
"Pong") == 0) port_ok =
true;
136 cout <<
"OnlMonComm::ConnectServer(): " << host <<
":" << port << endl;
142 if (port >= port0 + n_port) port -= n_port;
void SetSpillRangeHigh(const int sp)
void AddSpill(const int id)
void GetSpillRange(int &sp_lo, int &sp_hi)
TSocket * ConnectServer()
static std::string GetHost()
void SetSpillRange(const int sp_lo, const int sp_hi)
void SetSpillRangeLow(const int sp)
int ReceiveFullSpillRange()
void FindFullSpillRange(int &id_min, int &id_max)
static OnlMonComm * instance()
static void SetPort(const int port)
void GetFullSpillRange(int &id_min, int &id_max)