Example #1
0
				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;
}
Example #3
0
 inline void WriteValue(OutStream& out, const Type& t)
 {
      out.write(reinterpret_cast<const char*>(&t), sizeof(Type));
 }