Well before hand im creating a vector with data into it then modiftying it thru other functions. Then running a send function that passes these modifcations.
Now what about Recv would it be ok to do the same?
1 2 3 4 5 6 7 8 9
typedef std::vector<unsignedchar> recvbufferprt;
unsigned recvd = 0;
recvd = recv( sckSocket,(char*)&recvbufferprt, recvbufferprt.size(), 0 );
if (socket is zero)
{
// disconnect the socket here
}
Yes of course. The same principles apply :)
std::vector<unsigned char> has the same memory layout as unsigned char from C. There shouldn't be an issue.