So I am making this tcp program which simply sends and receives information between a client and a server.

My setup works as follows:

1)Server starts listening

2)Client sends "hello" command as well as a username/password

3)Server sends either "correctpass" or "wrongpass"

4)Client starts sending massive amounts of data in 50kb intervals

5)Server receives and stores this data as it comes

My question is: **Is there something I should do to make sure that client doesn't send data when the server isn't listening? Forexample, should there be a command sent from server saying that it successfully got the data? I am just wondering this because I can't have the data come not in order.**

I am receiving via tcp and I understand that TCP should send all the data to the server, but my problem is that the server might not be reading at the time that it is sent to it.

My other question is: **Is TCP a good protocol for sending lots of small data (adding up to alot) through the internet? Is this how dropbox and other sync utilities communicate with their servers?** 

Edit:
I am currently using C# and networkstream to communicate

Thanks,

Rohit