use std::array instead of raw c array
use a template to replace most instances of tcp_send_len, this should be safer when sending constants because we don't risk human error as much