I work on a select model socket client, where I have many outgoing connections that are being handled by 1 thread. Is there anything that I should be aware of when im doing send and recv call?
Are there any possibilities I wouldnt get all the data when socket is ready to read?
I have made a socket class where I have information for each socket stored. Would it be better to make a pointer char for recv buf in a class, when recieving data on read call. Is there any need for that? Would it be smart to use ioctl(The_Socket, FIONREAD, &num_bytes); to get the number of bytes that are ready to read, to allocate the memory in the buffer or just allocate some number, and then loop with recv?
Also another question, would it be better to loop when sending data till all data is sent like
or just normal send, and store with char pointer if there is data that wasnt sent out yet?
Thanks a lot for your help