make read_sock() return a char count