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

Method SyncWrite

net/linux/SocketImpl.cpp:64–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64void 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
85void CSocketImpl::SyncConnection(const std::string& ip, uint16_t port) {
86 if (ip.length() > 16) {

Callers

nothing calls this directly

Calls 3

GetCanReadLengthMethod · 0.45
WriteMethod · 0.45
AddSendEventMethod · 0.45

Tested by

no test coverage detected