code snippets for initial enet tests
- make build scripts for server and client using g++
- use snippets from here to make client and server
- instead of installing binaries of
flatbuffer
, compile the specific version usingcmake
-- it will generate theflatc
binary. to generate the command - usually, there is a flatbuffer submodule under
third_party
- build it using these instructions
- generate code from a schema :
cd schema && ./parse_schema
-- this will generate*_generated.h
files - if you need a mutating flatbuffer, use the
--gen-mutable
flag after calling the executable - for mutating flatbuffer, you might have to set all the fields first
-
- robot_signal_builder (struct) : has flatbufferbuilder, enet_server, and an enet_peer
-
- send_signal (method): to either build a new buffer or mutate an existing buffer and sennd a packet over enet
- the pointer to the robot_signal_build can be passed to other threads that can then then call the send_signal methods when needed to send the buffer to enet peers.
- these, along with enet operations, can be packaged into a
network_base.h
header file