#include <string.h> #include <iostream> #include <vector> #include <stdio.h> #include <stdlib.h> #include <boost/algorithm/string.hpp> int main() { //std::string bns = "list://cp01-spi-fresh2.cp01.baidu.com:8004"; std::string bns = "bns://exdata-server.ps-wcb.yq01"; baidu::rpc::ChannelOptions option; option.connection_type = baidu::rpc::CONNECTION_TYPE_SINGLE; baidu::rpc::Channel channel; if(channel.Init(bns.c_str(), "rr", &option) != 0){ return -1; } ps::spider::ExdataService_Stub stub(&channel); char str[1024]; while(true){ char* l = fgets(str, sizeof(str), stdin); if(NULL == l) break; int len = strlen(str); str[len-1] = '