Example #1
0
	inline void write(message & msg, uint64_t val)
	{
		byte_t type = uint64_type;

		msg.write((const byte_t*)&type,1);

		msg.write((const byte_t*)&val,sizeof(val));
	}
Example #2
0
	inline void write(message & msg, const char * message)
	{
		byte_t type = cstring_type;

		uint16_t length = (uint16_t)strlen(message);

		msg.write((const byte_t*)&type,1);

		uint16_t l = ntohs(length);

		msg.write((const byte_t*)&l,sizeof(l));

		msg.write((const byte_t*)&message,length);
	}