msgr->set_need_addr(true);
if (msgr->get_myaddr().get_port() == 0) {
- listen_addr.nonce = msgr->get_nonce();
+ listen_addr.nonce = nonce;
msgr->set_myaddr(listen_addr);
}
ldout(msgr->cct,10) << " will try " << addr << dendl;
int r = bind(addr, old_port, avoid_port);
if (r == 0)
- start();
+ start(nonce);
return r;
}
-int Accepter::start()
+int Accepter::start(uint64_t nonce)
{
ldout(msgr->cct,1) << "accepter.start" << dendl;
+ this->nonce = nonce;
// start thread
create();
SimpleMessenger *msgr;
bool done;
int listen_sd;
+ uint64_t nonce;
public:
Accepter(SimpleMessenger *r) : msgr(r), done(false), listen_sd(-1) {}
void stop();
int bind(entity_addr_t &bind_addr, int avoid_port1=0, int avoid_port2=0);
int rebind(int avoid_port);
- int start();
+ int start(uint64_t nonce);
};
bool get_need_addr() const { return need_addr; }
void set_need_addr(bool b) { need_addr = b; }
- uint64_t get_nonce() const {
- return nonce;
- }
-
private:
/**
* false; set to true if the SimpleMessenger bound to a specific address;