torch/lib/c10d/TCPStore.cpp
// query communicates with the worker. The format
// of the query is as follows:
// type of query | size of arg1 | arg1 | size of arg2 | arg2 | ...
// or, in the case of wait
// type of query | number of args | size of arg1 | arg1 | ...
query communicates with the worker.
query communicates with the worker .
void TCPStoreDaemon::query(int socket) {
  QueryType qt;
  tcputil::recvBytes<QueryType>(socket, &qt, 1);
  if (qt == QueryType::SET) {
    setHandler(socket);
  } else if (qt == QueryType::ADD) {
    addHandler(socket);
  } else if (qt == QueryType::GET) {
    getHandler(socket);
  } else if (qt == QueryType::CHECK) {
    checkHandler(socket);
  } else if (qt == QueryType::WAIT) {
    waitHandler(socket);
  } else {
    throw std::runtime_error("Unexpected query type");
  }
}
void TCPStoreDaemon :: query ( int socket ) { QueryType qt ; tcputil :: recvBytes < QueryType > ( socket , & qt , 1 ) ; if ( qt == QueryType :: SET ) { setHandler ( socket ) ; } else if ( qt == QueryType :: ADD ) { addHandler ( socket ) ; } else if ( qt == QueryType :: GET ) { getHandler ( socket ) ; } else if ( qt == QueryType :: CHECK ) { checkHandler ( socket ) ; } else if ( qt == QueryType :: WAIT ) { waitHandler ( socket ) ; } else { throw std :: runtime_error ( " " ) ; } }
query communicates with the worker.
query communicates with the worker .