Commit 8ac3f93b authored by mayankkakad's avatar mayankkakad

adding new server tested and corrected

parent 45626f12
......@@ -69,6 +69,7 @@ public:
fout<<info.address()<<endl;
fout.close();
null.set_nothing(0);
cout<<info.address()<<endl;
addAddressResponder.Finish(null,Status::OK,this);
}
else {
......@@ -76,30 +77,11 @@ public:
status = FINISH;
}
else {
if(reqType==ADDADDRESS)
print_servers_list();
GPR_ASSERT(status == FINISH);
delete this;
}
}
void print_servers_list() {
ifstream fin;
map<int,string> servers;
int size=0;
fin.open(SERVERS);
do {
string temp;
getline(fin,temp);
if(temp.size()==0)
break;
servers[size++]=temp;
}while(fin);
fin.close();
for(int i=0;i<size;i++)
cout<<servers.find(i)->second<<endl;
}
private:
KeyValueServices::AsyncService *service;
ServerCompletionQueue *cq;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment