Rev 1593 | Rev 1595 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1593 | Rev 1594 | ||
|---|---|---|---|
| Line 17... | Line 17... | ||
| 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 18 | * |
18 | * |
| 19 | */ |
19 | */ |
| 20 | 20 | ||
| 21 | #include "Manager.h" |
21 | #include "Manager.h" |
| 22 | - | ||
| 23 | #include <iostream> |
- | |
| 24 | 22 | ||
| 25 | #include <boost/lexical_cast.hpp> |
23 | #include <boost/lexical_cast.hpp> |
| 26 | #include <boost/bind.hpp> |
24 | #include <boost/bind.hpp> |
| - | 25 | #include <boost/cast.hpp> |
|
| 27 | 26 | ||
| 28 | namespace atom { |
27 | namespace atom { |
| 29 | namespace net { |
28 | namespace net { |
| 30 | 29 | ||
| 31 | Manager::Pointer Manager::instance_ = Manager::Pointer(new Manager()); |
30 | Manager::Pointer Manager::instance_ = Manager::Pointer(new Manager()); |
| Line 75... | Line 74... | ||
| 75 | TcpClient::Pointer client = TcpClient::Pointer(new TcpClient(this->io_service_, this->GetFreeClientId(), it->second->GetServerId())); |
74 | TcpClient::Pointer client = TcpClient::Pointer(new TcpClient(this->io_service_, this->GetFreeClientId(), it->second->GetServerId())); |
| 76 | 75 | ||
| 77 | client->ConnectSlots(Client::SignalOnNewState::slot_type(&Manager::SlotOnNewState, this, _1, _2, _3).track(Manager::instance_), |
76 | client->ConnectSlots(Client::SignalOnNewState::slot_type(&Manager::SlotOnNewState, this, _1, _2, _3).track(Manager::instance_), |
| 78 | Client::SignalOnNewData::slot_type(&Manager::SlotOnNewData, this, _1, _2, _3).track(Manager::instance_)); |
77 | Client::SignalOnNewData::slot_type(&Manager::SlotOnNewData, this, _1, _2, _3).track(Manager::instance_)); |
| 79 | 78 | ||
| 80 | client->Accept( |
79 | client->Accept(boost::polymorphic_downcast<TcpClient*>(it->second.get())->ReleaseAcceptor()); |
| 81 | 80 | ||
| 82 | this->clients_[client->GetId()] = client; |
81 | this->clients_[client->GetId()] = client; |
| 83 | 82 | ||
| 84 | this->signal_on_new_state_(client_id, server_id, CLIENT_STATE_CONNECTED); |
83 | this->signal_on_new_state_(client_id, server_id, CLIENT_STATE_CONNECTED); |
| 85 | return; |
84 | return; |