user140053
user140053

Reputation:

Sending datas by chunk

in C, I have to send a bunch of datas with tcp/ip (~6.5mo) I'm using the "classic" send(). Do you think it's a good idea to give to the function the whole size of data to send in one part or should I prefer the chunk way (slices of, for example, 64ko...)

Upvotes: 1

Views: 286

Answers (1)

MByD
MByD

Reputation: 137442

Give it the full size, and just call it again with the rest of the buffer (according to the return value).

You deal with your logic, let the OS deal with the send logic.

Upvotes: 5

Related Questions