Jumanji
Jumanji

Reputation: 71

Is Sending a File Over a Network Faster Than Downloading?

Alright, so I'm creating an application, and in it, the clients need to communicate with the server as soon as it launches. So I have two ideas for this. (A) I could have it so that the client sends a message to the server using TCP/IP to tell it what it needs, and the server sends that back over the connection, or the client just downloads a file from a web server.

Since both are transferring the same file over the network, both should be the same speed right? Well I don't know, that's why I'm asking. And I know that somebody will probably say "oh well try it yourself", and I'm sure I could if I got a runtime operation and used that with both, but I don't have my server set up yet, and I would change how it operates severely if I knew ahead of time.

So, is it faster to download from a web server, or contact a server and have it send the information over? And if there's any better idea as for getting info from the server, let me know!

Upvotes: 0

Views: 475

Answers (1)

BradleyDotNET
BradleyDotNET

Reputation: 61369

Your two operations are; from a network perspective, identical:

  1. Client establishes TCP socket to server
  2. Client sends request for file
  3. Server responds with file

Using HTTP as the format of the request doesn't change the nature of the operation. You do have to deal with the overhead of going through the web server logic, but that is almost certainly negligible in comparison to the actual network operation.

Upvotes: 2

Related Questions