Conceptually, I think of a TCP connection as having two aspects.
- The "connection" - i.e. an arrangement where the two hosts "agree" to commnunicate with each other. loosely analogous to calling someones phone and, when they pick up at the other end you have a "connection".
- The data transfer
The connection aspect of TCP is well covered in documents on the web, hosts negotiate the connection via 3 way handshake etc, but at this point you only have an idle connection - again analogous to someone picking up the phone at the other end and having "dead air"
My question is, once this connection is established, how is data, e.g. a file transfer initiated? I would imagine it looks something like the sender outlining what its going to send, i.e. "Im going send you ...., and you will know the transfer is complete when you have a file of X bytes, or you receive a trailer from me". How does a TCP data/file transfer get started?
socket_bind()-->socket_connect()-->socket_send(<your_data>)--- to TCP server