| 62 | } |
| 63 | |
| 64 | void CSocketImpl::SyncWrite(const char* src, uint32_t len) { |
| 65 | if (!_write_event->_client_socket) { |
| 66 | _write_event->_client_socket = memshared_from_this(); |
| 67 | } |
| 68 | |
| 69 | _write_event->_event_flag_set |= EVENT_WRITE; |
| 70 | |
| 71 | //can't send now |
| 72 | if (_write_event->_buffer->GetCanReadLength() > 0) { |
| 73 | _write_event->_buffer->Write(src, len); |
| 74 | if (_event_actions) { |
| 75 | _event_actions->AddSendEvent(_write_event); |
| 76 | } |
| 77 | |
| 78 | } else { |
| 79 | // try send now |
| 80 | _write_event->_buffer->Write(src, len); |
| 81 | Send(_write_event); |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | void CSocketImpl::SyncConnection(const std::string& ip, uint16_t port) { |
| 86 | if (ip.length() > 16) { |
nothing calls this directly
no test coverage detected