Although the direct read/write with uint8_t* data, size_t len is often a solid API for low level systems, in this particular project it lends itself to excessive copying. This is not a disaster for most applications, but given the amount of copying already present in both wxWidgets and Libevent, buffers should be treated as abstract objects, capable of reading, writing, and mapping, with their concrete implementations being populated with runtime specific data. This would also be an improvement given that both libraries are extremely opinionated in how they want message data processed, and some common abstraction could hide that.
Although the direct
read/writewithuint8_t* data, size_t lenis often a solid API for low level systems, in this particular project it lends itself to excessive copying. This is not a disaster for most applications, but given the amount of copying already present in both wxWidgets and Libevent, buffers should be treated as abstract objects, capable of reading, writing, and mapping, with their concrete implementations being populated with runtime specific data. This would also be an improvement given that both libraries are extremely opinionated in how they want message data processed, and some common abstraction could hide that.