sockets - Is there an 'optimal' buffer size when using send()? -


let's you're transferring file of arbitrary length in chunks on tcp/ip:

looping...     read(buffer, length)     send(mysocket, buffer, length, flags) 

my question is, optimal value of length? or not matter @ all? i've seen 256 bytes 8192 bytes being used.

depends mean optimal. optimal usage of bandwidth, want maximize packet size send @ least network packet size (which on ethernet 1500 bytes). if reading disk 4096 or 8192 bytes value.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -