This commit is contained in:
zhouhuang 2024-12-05 20:23:37 +08:00
parent 287b6ed3e4
commit e75ee99285

View File

@ -218,6 +218,9 @@ size_t Socket::write(const Frame& frame) const
LOG_ERROR("frame length: " << frame.size() << " exceeds maximum length for sockets");
return 0;
}
if (m_Socket == INVALID_SOCKET) return 0;
if (m_DestAddr == 0) return 0;
if (m_DestAddrLen <= 0) return 0;
const int bufferLength = static_cast<int>(frame.size());
const char* const buffer = reinterpret_cast<const char*>(frame.data());