| 60 | } |
| 61 | |
| 62 | void CSocketImpl::SyncWrite(const char* src, uint32_t len) { |
| 63 | _write_event->_buffer->Write(src, len); |
| 64 | |
| 65 | if (!_write_event->_client_socket) { |
| 66 | _write_event->_client_socket = memshared_from_this(); |
| 67 | } |
| 68 | |
| 69 | if (_event_actions) { |
| 70 | _write_event->_event_flag_set = 0; |
| 71 | _write_event->_event_flag_set |= EVENT_WRITE; |
| 72 | if (_event_actions->AddSendEvent(_write_event)) { |
| 73 | _post_event_num++; |
| 74 | |
| 75 | // something wrong |
| 76 | } else { |
| 77 | auto cppnet_ins = GetCppnetInstance(); |
| 78 | if (cppnet_ins) { |
| 79 | cppnet_ins->_ReadFunction(_read_event, ERR_CONNECT_CLOSE | EVENT_DISCONNECT); |
| 80 | } |
| 81 | } |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | void CSocketImpl::SyncConnection(const std::string& ip, uint16_t port, const char* buf, uint32_t buf_len) { |
| 86 | if (ip.length() > 16 || ip.empty()) { |
no test coverage detected