Single Socket Vs Multiple Socket
I have a client and a server and i need to transfer a fixed amount of data from the client to the server.
Please consider these two scenarios -
1. I create a program which opens a single socket connection to the server and starts sending data sequentially. Assume that there is no data is to be received.
2. I create another program with two threads which in turn create 2 sockets to the server. These two threads now start sending the data on two sockets to the server. Assume the data to send is divided between the two threads equally. Also assume that there is no data is to be received and the order in which data is send to the server is not important.
Now my question is, which of the above two process will finish first? Does creating more sockets amount to increased transfer rate? If yes, then how?