Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

in c, you can vary the chunk size when send a file to a host socket...

Status
Not open for further replies.

phn737

Technical User
Nov 4, 2002
31
0
0
US
in c, you can vary the chunk size when send a file to a host socket. how is this accomplish? how can it be done in perl?
 
print $socket substr($file,0,512);
print $socket substr($file,512,512); etc
 
cdlvj,
in your sample, it looks like only portion of the file got read (by substr) and sent. how repeat/loop to send entire file? this is what i currently have:

...
while ( read( OpenedFile, $file, $myBufferSize ) ) {
# print $socket substr($file,0,512);
# print $socket substr($file,512,512); etc
print $socket substr($file,0,512);
}
...

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top