Dennis wrote:
> That's fair to say, but I know it must be logical. Logically --or,
> better, functionally-- a client sends out some information to a server
> (a web page request), and then, some time later, the server sends out
> some information (a web page) back to the client.
That's not really how it works.
The client initiates a TCP connection with the server. A TCP connection
can be thought of as a pipe with two ends. (To continue the pipe analogy,
you can think of all computers as having thousands of numbered holes in
them called "ports", and that you can connect up pipes to the ports. The
ports also have valves on them allowing them to be opened and closed. When
they're closed, no pipes can be connected to the port.)
One end is connected to port 80 of the web server, which was sitting
there left open, waiting for people to connect to it. The other end of the
pipe is connected to a randomly-selected unused port on the client, which
had been closed, but was opened by the web browser for this special
purpose.
Now a pipe connection has been established between the two computers. The
browser writes a note on a bit of paper requesting a file and pushes it
down the pipe. The server reads the request and puts its response on
another bit of paper and pushes it back down the pipe in the opposite
direction. The client recieves the response and closes that
randomly-selected port. And because pipes can't be connected to closed
ports, the pipe magically disappears.
Now think about it -- how can the server push another response back to the
client? The original pipe has disappeared. It could try connecting another
pipe up, but the port it used before is now closed. It could look for
another open port on the client, but there's no guarantee that if it sent
a piece of paper to a different port that it would be collected by the
browser at the other end, and not by some other bit of software, like some
mail serving software that would just be confused about getting a random
web page.
The only way it can be done is if the client has some software running
that opens up a predetermined port and sits there waiting for a web page
to be sent into the port -- which is what GreyWyvern suggested.
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ <a style='text-decoration: underline;' href="http://tobyinkster.co.uk/contact" target="_blank">http://tobyinkster.co.uk/contact</a><!-- ~MESSAGE_AFTER~ -->
>> Stay informed about: Sending out web pages without an invitation