| 83 | } |
| 84 | |
| 85 | void CSocketImpl::SyncConnection(const std::string& ip, uint16_t port) { |
| 86 | if (ip.length() > 16) { |
| 87 | base::LOG_ERROR("a wrong ip! %s", ip.c_str()); |
| 88 | return; |
| 89 | } |
| 90 | strcpy(_ip, ip.c_str()); |
| 91 | _port = port; |
| 92 | |
| 93 | if (!_read_event->_client_socket){ |
| 94 | _read_event->_client_socket = memshared_from_this(); |
| 95 | } |
| 96 | |
| 97 | if (_event_actions) { |
| 98 | _read_event->_event_flag_set |= EVENT_CONNECT; |
| 99 | _event_actions->AddConnection(_read_event, ip, port); |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | void CSocketImpl::SyncDisconnection() { |
| 104 | if (!_read_event->_client_socket) { |
nothing calls this directly
no test coverage detected