Rev 1599 | Rev 1606 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1599 | Rev 1601 | ||
|---|---|---|---|
| Line 29... | Line 29... | ||
| 29 | namespace atom { |
29 | namespace atom { |
| 30 | namespace net { |
30 | namespace net { |
| 31 | 31 | ||
| 32 | Manager::Pointer Manager::instance_; |
32 | Manager::Pointer Manager::instance_; |
| 33 | 33 | ||
| 34 | Manager::Manager( |
34 | Manager::Manager() |
| 35 | { |
35 | { |
| 36 | boost::thread thread(boost::bind(&boost::asio::io_service::run, &this->io_service_)); |
- | |
| 37 | this->thread_ = thread.move(); |
- | |
| 38 | } |
36 | } |
| 39 | 37 | ||
| 40 | Manager::~Manager() |
38 | Manager::~Manager() |
| 41 | { |
39 | { |
| 42 | this->clients_.clear(); |
40 | this->clients_.clear(); |
| 43 | - | ||
| 44 | this->io_service_.stop(); |
- | |
| 45 | - | ||
| 46 | this->thread_.interrupt(); |
- | |
| 47 | this->thread_.join(); |
- | |
| 48 | } |
41 | } |
| 49 | 42 | ||
| 50 | Manager::Pointer Manager::Instance() |
43 | Manager::Pointer Manager::Instance() |
| 51 | { |
44 | { |
| 52 | return Manager::instance_; |
45 | return Manager::instance_; |