the send function doesn’t except uint8_t* so you should cast the contents of the vector like this : (const char*)data1.data();
Also the vector class doesn’t have length () method you should use size()
solved C++ sending a vector across a socket connection