MCPcopy Create free account
hub / github.com/caozhiyi/CppNet / SyncConnection

Method SyncConnection

net/linux/SocketImpl.cpp:85–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85void 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
103void CSocketImpl::SyncDisconnection() {
104 if (!_read_event->_client_socket) {

Callers

nothing calls this directly

Calls 1

AddConnectionMethod · 0.45

Tested by

no test coverage detected