… | |
… | |
268 | struct SockList |
268 | struct SockList |
269 | { |
269 | { |
270 | SockList () : buf (0), len (0) { } |
270 | SockList () : buf (0), len (0) { } |
271 | SockList (int size) : buf ((uint8 *)malloc (size)), len (0) { } |
271 | SockList (int size) : buf ((uint8 *)malloc (size)), len (0) { } |
272 | |
272 | |
|
|
273 | void reset () { len = 0; } |
273 | int length () const { return len; } |
274 | int length () const { return len; } |
274 | |
275 | |
275 | SockList &operator <<(uint8 v) { buf [len++] = v; return *this; } |
276 | SockList &operator <<(uint8 v) { buf [len++] = v; return *this; } |
276 | |
277 | |
277 | SockList &operator <<(uint16 v) { return *this << uint8 (v >> 8) << uint8 (v); } |
278 | SockList &operator <<(uint16 v) { return *this << uint8 (v >> 8) << uint8 (v); } |