void sendMessage(const void* data, int size) { if (os.isValid() && ready) { // printf("sendMessage()\n"); ready = false; os.write(data, size, this); } else printf("sendMessage(): %s not ready!\n", remoteHost.keyStr().c_str()); }
std::size_t DataRefInStream::read(OutStream& os, std::size_t len) { auto size(std::min(mData.size() - mPosition, len)); os.write(DataRef(mData.begin() + mPosition, mData.begin() + mPosition + size)); mPosition += size; return size; }
inline void WriteValue(OutStream& out, const Type& t) { out.write(reinterpret_cast<const char*>(&t), sizeof(Type)); }