This is a discussion on web application working within the Linux Networking forums, part of the Linux Forums category; hi i have a problem see when we connect to any web server then according to http protocol we connect ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
hi
i have a problem see when we connect to any web server then according to http protocol we connect on port 80 so when we connect to server on port 80 it means that a socket is created on server which binds the port 80 with let say to a client A Now the communication will be done by this socket ( now this port will not used by any other socket) so when any other client B will try to connect with the same server how it will connect i mean the socket is already occupied by this socket. may be it is a stupid question but please answer this so that i can clear the situation more see what i am doing is i have created a server which is listening on port 10000 now whenever a client try to connect it it gets connected (opens a socket) do working so now when any other client B trying to connect on same port so is possible that server again get connected to client B on this same socket ????? please do reply |
|
|||
|
"shan" <shan.icwa@gmail.com> writes:
> hi Hi, > i have a problem > see when we connect to any web server then according to http protocol > we connect on port 80 so when we connect to server on port 80 it > means that a socket is created on server which binds the port 80 with > let say to a client A Now the communication will be done by this > socket ( now this port will not used by any other socket) so when any > other client B will try to connect with the same server how it will > connect i mean the socket is already occupied by this socket. > may be it is a stupid question but please answer this so that i can > clear the situation more Lets call the socket [server:80] welcome socket. When someone say hello to the welcome socket, the server open a new soket (on a port over 1024) to speak with the client. The welcome socket is then free. Hope this helps. -AJ ps. sorry, i've first answered on your mail. |
|
|||
|
u mean to say when i first connect to the server then i get connected
to port 80 then after that again server makes connection to us on some different port now that means from next call we dont get connected to port 80 and our communication is going on some differnet ports now lets say there are 100000 clients for any server so that mean server should have 100000 different ports which is not possible (65000 limits) |
|
|||
|
Hello,
Please quote your mail correctly, it's better to know about what we are speaking. "shan" <shan.icwa@gmail.com> writes: > u mean to say when i first connect to the server then i get connected > to port 80 then after that again server makes connection to us on some > different port now that means from next call we dont get connected to > port 80 and our communication is going on some differnet ports That's what I say. > now lets say there are 100000 clients for any server so that mean > server should have 100000 different ports which is not possible (65000 > limits) I don't know how will react the server but it certainly won't be able to handle that. Hope this helps. -AJ |
|
|||
|
On Wed, 17 May 2006 04:03:19 -0700, shan wrote:
> u mean to say when i first connect to the server then i get connected to > port 80 then after that again server makes connection to us on some > different port now that means from next call we dont get connected to port > 80 and our communication is going on some differnet ports now lets say > there are 100000 clients for any server so that mean server should have > 100000 different ports which is not possible (65000 limits) No. The server always listens on the same port. A connection is defined by four parameters, server ip, server port, client ip and client port. The listening socket makes a connection with the remote client. It keeps the same local port and local ip address. The server then creates new listening socket, with the same local port number and local ip address. Any new connection will be unique, because even though the local ip address and port number will be the same, the remote combination of ip address and port number must be different. Dan |
|
|||
|
Dan N <dan@localhost.localdomain> writes:
> On Wed, 17 May 2006 04:03:19 -0700, shan wrote: > > > u mean to say when i first connect to the server then i get connected to > > port 80 then after that again server makes connection to us on some > > different port now that means from next call we dont get connected to port > > 80 and our communication is going on some differnet ports now lets say > > there are 100000 clients for any server so that mean server should have > > 100000 different ports which is not possible (65000 limits) > > No. > > The server always listens on the same port. > > A connection is defined by four parameters, server ip, server port, client > ip and client port. > > The listening socket makes a connection with the remote client. It keeps > the same local port and local ip address. > > The server then creates new listening socket, with the > same local port number and local ip address. Any new connection will be > unique, because even though the local ip address and port number will be > the same, the remote combination of ip address and port number must be > different. Sorry for my mistakes. I was lost in a Java schema. -AJ |
|
|||
|
Dan N <dan@localhost.localdomain> said:
>On Wed, 17 May 2006 04:03:19 -0700, shan wrote: > >> u mean to say when i first connect to the server then i get connected to >> port 80 then after that again server makes connection to us on some >> different port now that means from next call we dont get connected to port >> 80 and our communication is going on some differnet ports now lets say >> there are 100000 clients for any server so that mean server should have >> 100000 different ports which is not possible (65000 limits) > >No. > >The server always listens on the same port. > >A connection is defined by four parameters, server ip, server port, client >ip and client port. > >The listening socket makes a connection with the remote client. It keeps >the same local port and local ip address. > >The server then creates new listening socket, with the >same local port number and local ip address. Any new connection will be >unique, because even though the local ip address and port number will be >the same, the remote combination of ip address and port number must be >different. .... which, of course, is natural: the same socket number on the same client couldn't be reused for connections, as it is already in use. So, on client end it is not possible to have several programs use the same [ip:port] pair. To make this complete, there are some programs that behave somewhat as described by AJ: - client connects to a server - server acts as a service broker; clients asks for some service, server responds with connection information for the said service - client disconnects from the (broker) server - client connects to the server by address obtained via the broker - "business load" - disconnect .... and it could even be that the broker actually creates the other server upon the client request, and just assigns a port for it at that very time. -- Wolf a.k.a. Juha Laiho Espoo, Finland (GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++ "...cancel my subscription to the resurrection!" (Jim Morrison) |