i am openning a file and printing it to a socket. what i want to do is to be able to control the chunk size of the packet being sent (ie. 128K or 512K or 1024K etc...), how can i do this? thx
Somebody once told me that one TCP packet can be a maximum of 1024 bytes... so that might be your answer right there. You'd have to send it in multiple packets in that case.
anyone else have any suggestion? Kirsle comment seems incorrect:
he maximum packet size (also called the MTU, or Maximum Transmission Unit) and default packet size can vary depending on the media. For ethernet (LAN), the max packet size is 1500 octets. For dialup, it is 576 octets. For token ring and FDDI, it is 4096 octets.
currently i'm trying to read the buffer with smaller size but this is not the same as sending a small packet to the host, as my timimg result shows same throughtput time regardless of read buffer size. I am expecting a longer transmission time if the packet chunk size/buffer is smaller ie 128k vs 1024k...
...
while ( read( OF, $buffer, $readBufferSz ) ) {
print $socket $buffer;
...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.