Thread: How to transfer a big file only one time?

  1. #1
    Registered User
    Join Date
    Jun 2011

    How to transfer a big file only one time?

    The file size is about 400k,I want to transfer the big file only one time,
    I want to know I must use TCP or UDP?and Must I set the sending buffer or receiving buffer to 400k?

  2. #2
    Join Date
    Aug 2010
    Ontario Canada
    Ok, if this is a one time thing... I'd suggest just using your OS facilities... seriously...

    If you're on windows, just put the thing in a shared folder and drag and drop it into the target machine.

    Writing Winsock code for a one file, one time transfer would be a horrendous waste of time and effort...

  3. #3
    Registered User
    Join Date
    Nov 2010
    Long Beach, CA
    To answer your questions:
    400k is quite small by today's standard. You should use TCP because it guarantees that the packets are in order, where UDP does not. And you can set the buffer smaller if you want, and to multiple writes, but keep in mind the TCP/IP stack you're working on has it's own buffer (typically 1500 bytes IIRC), so it wont send your whole buffer in one shot anyhow.

    Like Tater said, writing a program for this is silly, unless it's solely to learn about network programming. Read Beej's network programming guide for info on network programming. You should look into using the cURL library if you want to use specific protocols like FTP or HTTP. Also, you should do some general reading on ethernet and TCP/IP.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. I can't transfer file,who could help me?
    By leetow2003 in forum Linux Programming
    Replies: 1
    Last Post: 07-05-2011, 10:39 PM
  2. Host/Server real time data transfer
    By dannyrod01 in forum Networking/Device Communication
    Replies: 9
    Last Post: 05-25-2011, 11:38 PM
  3. Replies: 1
    Last Post: 11-08-2010, 02:03 PM
  4. usb-to-usb file transfer using C/C++
    By young_virtuoso in forum Networking/Device Communication
    Replies: 1
    Last Post: 12-25-2006, 09:59 AM
  5. big file transfer
    By Pyroteh in forum Tech Board
    Replies: 2
    Last Post: 05-26-2005, 10:35 AM