Hi Aaron,
Here are some of the basics:
You can only open a single *passive* connection on a port. A passive
connection is a 'connection' that waits and listens for incoming
active connections. Once the web server starts listening on port 80 -
then no one else will be allowed to listen for incoming connections on
port 80 - this is why each server program listens on a different port.
You can have multiple *active* connections on a single port, as long
as each connection is unique, as determined by these 4 pieces of
information:
1) Host IP address
2) Host port
3) Client IP address
4) Client port
So for instance, if I run "netstat" from the command line I see my
computer has 2 concurrent connections open to a web server on my
network, but these connections originate from different local ports
(that IE picked at random):
Proto Local Address Foreign Address
TCP mycomputer:4239 10.10.10.10:http
TCP mycomputer:3927 10.10.10.10:http
(Also note Netstat replaces IP and PORT numbers with names when it
can).
As long as each connection is unique, there is never any confusion as
to where to send a packet. You can imagine 200 concurrent users
working because those 200 will all have different ClientIP:Port
address portions - and because each connection is *uniquely
identifiable* - the web server will always know where to send the
response.
Make sense?
--
Scott
http://www.OdeToCode.com/blogs/scott/
On Mon, 23 May 2005 21:58:46 -0700, "Aaron" <ku*****@yahoo.com> wrote:
I'm trying to learn how the HTTP protocol works. When aserver has many
clients accessing it at the same time. Say 200 people. How does it maintain
connection with 200 different concurrent client using only port 80? From
what I've read and if I understand this correctly, a TCP/UDP port a maintain
connection with one client at a time. Can someone explain it to me? I
believe FTP works the same way right?
Thanks in advance
Aaron