A Note About TCP/IP Network Connections |
A Note About TCP/IP Network Connections
In order to establish a TCP/IP connection you need to do the following.
Prior to anything happening,
there needs to be some agreement on the form of the data.
In HTML web pages there
is a string "http" that is often used. It means "HyperText Transfer
Protocol". What that means is that there is an agreement on the format
of the file that will be transferred from the server to the client and
how that file will be interpreted.
There are other protocols
that have been use - and are still used. One of those is "ftp" for
"File Transfer Protocol" which has been used for simple file transfers.
The server must "listen" for
a connection. In other words, the server must determine when a request has
come from a possible client. That address has to be sent to the correct IP
address and the correct port on the server computer.
When the server receives a
request, a connection is established. The phraseology is that a connection
is "opened".
After the connection is
established, the server needs to prepare the data for transmission in the
agreed-upon format.
Then the server needs to send
the data.
When everything is complete,
the server closes the connection.
Some things to note are the following:
Things can happen. For
example, the client computer can crash and the data may not get to the
client. When that happens, the connection should terminate gracefully. (It
shouldn't cause any problems at the server, in other words.)
There absolutely, positively
must be an agreement - referred to as a "protocol" - between the server and
the client. In many cases, a standard protocol - like http - is used, but
that does not eliminate the possibility of a unique protocol for your
situation. Simple data servers - like a server giving stock quotes - can
use very simple protocols. Over time, the http protocol has expanded to
include many things beyond what was in the original version of HTML.
|