void PeerServer::sync_new_member(set<Member>::iterator nit) { UpdateRequest request; for (set<Member>::iterator it = members.begin(); it != members.end(); it++) { if (it != nit) { request.members.push_back(*it); } } if (nit == members.end()) { cerr << __func__ << ": Internal error" << endl; exit(EXIT_FAILURE); } RemoteConnection connection(*nit); if (!connection.open) { cerr << __func__ << ": connection failed" << endl; return; } request.serialize(connection); connection.close(); }
void PeerServer::notify_old_members_del(const Member& member) { for (set<Member>::iterator it = members.begin(); it != members.end(); it++) { UpdateRequest request; RemoteConnection connection(*it); if (!connection.open) { cerr << __func__ << ": connection failed" << endl; continue; } request.add = false; request.members.push_back(member); request.serialize(connection); connection.close(); } }