If I want to transfer 2 files at the same time through a TCP socket (to a single client) is it possible to do so through a single socket or do I need 2 sockets to do so?
I do not want file#2 to wait for file#1 to transfer before being transferred. I want them to transfer at the same time.
If I need 2 sockets, what would be the best way to do it? I don’t suppose it’s possible to just copy the socket and transfer through that as well?
Yes it is possible, but queuing theory tells us that transferring one first followed by the other is better according to most speed metrics. And also needs less logic.
So why do you need to transfer them in parallel? Are the files growing during the transfer, or some other reason that you can’t finish transferring one first?