mirror of
https://github.com/ceph/ceph
synced 2025-01-03 09:32:43 +00:00
* SimpleMessenger only lets you do start_rank once
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1288 29311d96-e01e-0410-9327-a35deaab8ce9
This commit is contained in:
parent
981f2a1b65
commit
cebf62664b
@ -697,7 +697,8 @@ void Rank::Pipe::fail(list<Message*>& out)
|
||||
*/
|
||||
|
||||
Rank::Rank() :
|
||||
single_dispatcher(this) {
|
||||
single_dispatcher(this),
|
||||
started(false) {
|
||||
// default to any listen_addr
|
||||
memset((char*)&listen_addr, 0, sizeof(listen_addr));
|
||||
listen_addr.sin_family = AF_INET;
|
||||
@ -787,7 +788,14 @@ void Rank::reaper()
|
||||
|
||||
int Rank::start_rank()
|
||||
{
|
||||
lock.Lock();
|
||||
if (started) {
|
||||
dout(10) << "start_rank already started" << endl;
|
||||
lock.Unlock();
|
||||
return 0;
|
||||
}
|
||||
dout(10) << "start_rank" << endl;
|
||||
lock.Unlock();
|
||||
|
||||
// bind to a socket
|
||||
if (accepter.start() < 0)
|
||||
@ -802,7 +810,7 @@ int Rank::start_rank()
|
||||
lock.Lock();
|
||||
|
||||
dout(1) << "start_rank at " << listen_addr << endl;
|
||||
|
||||
started = true;
|
||||
lock.Unlock();
|
||||
return 0;
|
||||
}
|
||||
|
@ -238,7 +238,8 @@ private:
|
||||
public:
|
||||
Mutex lock;
|
||||
Cond wait_cond; // for wait()
|
||||
|
||||
bool started;
|
||||
|
||||
// where i listen
|
||||
tcpaddr_t listen_addr;
|
||||
entity_addr_t my_addr;
|
||||
|
Loading…
Reference in New Issue
Block a user