[gnet] Using pack to pack an array



Hello people!

First of all, thanks for a great library! :o)

My problem is that I want to send a standard C++ array of structs using
pack, while I can't figure out a way to do it. This is what I want to
pack (and unpack):

#define MAX_NUMBER_OF_CLIENTS 10

struct pos
{
	int x, y;
};

static pos positions[MAX_NUMBER_OF_CLIENTS];

Can you give me some hints? I've been reading on
http://metric.it.uab.edu/doc/linux/gnet-1.1.0/html/gnet-pack.html and
I'm sure the answer is there somewhere, but I can't find it...

Thanks in advance!

-- 
Jon Kristensen
Ordförande/President, Dedikerad




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]