How to transfer a big file only one time?

This is a discussion on How to transfer a big file only one time? within the Networking/Device Communication forums, part of the General Programming Boards category; The file size is about 400k,I want to transfer the big file only one time, I want to know I ...

  1. #1
    Registered User
    Join Date
    Jun 2011
    Posts
    50

    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
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    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
    Location
    Long Beach, CA
    Posts
    5,555
    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, 01: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, 08:59 AM
  5. big file transfer
    By Pyroteh in forum Tech Board
    Replies: 2
    Last Post: 05-26-2005, 10:35 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21