use size_t for size params when sending, int can be negative and is not guaranteed to be large enough