Transferring files over the network

Among FTP, HTTP, SSH, etc. and given a serial broadband internet connection, what is the fastest way to transfer files over the network?

+2


source to share


3 answers


Among those 3, its HTTP. The effective act of "transferring a file" has the same speed, but:

FTP requires too much "talk" to stabilize the session and creates parallel data connections, all of which "talk" takes a little longer to start transferring files. For the same reason, you may have problems with firewalls and routers due to opening FTP ports, especially if the FTP client does not support "passive mode".

HTTP is more objective, you bind, say what you want and get it as a response. No, blah blah blah.



SSH is not a transfer protocol. SSH stands for "Secure Shell". If you mean SSL, it is also not a transmission protocol, its a security level usually used by encapsulating HTTP sessions.

But maybe it's not a faster question, the real question is: what do you want to do? Depending on your problem, none of these might be an option.

+1


source


Use Socket.SendFile () if you can. This is the easiest way to get the file from point A to point B. Without knowing the specifics of what you are trying to accomplish, it is really difficult to give a better recommendation. FTP, I would probably use it differently, and System.Net has a pretty decent FtpClient object that you can use, and the samples document it quite well. HTTP and FTP use TCP, so you probably won't see a significant difference in speed between the two, and HTTP will usually have headers with different potential behavior (try downloading the file with Expect-100 Continue and no credentials to a server that requires AUTH and see what happens to your connections). With Socket.SendFile (), since sockets are agnostic by definition, you can send a file over UDP or TCP with the same code,but I would recommend this if you are sending over LAN where packet loss is almost 0 UDP over the Internet - not a good idea.



+1


source


Do you have control over the endpoints and any intermediate firewalls? FTP is less firewall than others. SSH-based tools (sftp, scp) are pretty good, but some ISPs have been known to throttle or otherwise interfere with encrypted traffic (Comcast, I'm looking at you!) Have you considered rsync? At my job, this is what we use to transfer huge datasets over long-range internet connections.

0


source







All Articles