abhishekvp / cesium-lg

Liquid Galaxy GSoC 2016 Project: Enabling Cesium for Liquid Galaxy
5 stars 3 forks source link

messaging types don't use a string? #33

Closed alfski closed 8 years ago

alfski commented 8 years ago

For the message type need come up with some message type identifier that isn't a string.

At the moment "ge-cam" or "state" appears as literal string in the packet. I was hoping protobuf would encode this more efficiently. At the moment it still takes up a bunch of bytes when it should be less than 1.

Using some constants would be fine. TYPE.cam = 0; TYPE.status = 1; TYPE.gecam=2 ? Or another idea?

tcpdump output...

18:25:04.232393 IP 10.237.10.1.8081 > 10.237.10.71.50687: Flags [P.], ack 1, win 123, length 76
    0x0000:  4500 0074 4284 4000 4006 cdde 0aed 0a01  E..tB.@.@.......
    0x0010:  0aed 0a47 1f91 c5ff 089e d0d5 75fd cdd1  ...G........u...
    0x0020:  5018 007b 2a88 0000 c24a 003e 00c1 ff0a  P..{*....J.>....
    0x0030:  0667 652d 6361 6d11 4680 20bd 05bb 6540  .ge-cam.F.....e@
    0x0040:  1985 63ca 050c aa43 c021 5200 fd50 096b  ..c....C.!R..P.k
    0x0050:  a240 29e3 88a1 f9b4 0bf6 3f31 0370 ddcd  .@).......?1.p..
    0x0060:  4ce7 c6bf 396b 3ce6 78f6 892f 3f00 0000  L...9k<.x../?...
    0x0070:  ffff 0200