Forum: Ruby on Rails How webrick works

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Salil G. (Guest)
on 2009-04-25 08:43
Hi All,
   I want to know what is the basic nature of a webrick.
Actually i create two instances of my application on my pc one on a
MOZILLA and second on a INTERNET EXPLORER.
on MOZILLA i uploaded 10 files and on INTERNET EXPLORER i upload only 1
file.
But it takes same time on both browser and page loading stop at the same
time.

i would like to know how webrick recognised who's request.

Regards
Salil
Phlip (Guest)
on 2009-04-25 09:11
(Received via mailing list)
Salil G. wrote:

>    I want to know what is the basic nature of a webrick.
> Actually i create two instances of my application on my pc one on a
> MOZILLA and second on a INTERNET EXPLORER.
> on MOZILLA i uploaded 10 files and on INTERNET EXPLORER i upload only 1
> file.
> But it takes same time on both browser and page loading stop at the same
> time.
>
> i would like to know how webrick recognised who's request.

I suspect you are asking how TCP/IP works.

Roughly speaking...

   host -> port -> sockets -> connections -> packets

...is the hierarchy of containers. The host is //localhost and the port
is
either :80 (invisible) or :3000 (explicit).

Webrick "listens" at a port until a client creates a socket and makes a
connection. The connection then persists, and another client can connect
at the
same port. (El Goog will lead you to many details of [socket listen]
here.)

A connection is like a virtual pair of wires. The server and client
communicate
by sending and recv'ing messages, and the connection protocol cuts these
up into
packets. Because Webrick only messes with one packet at a time (again,
roughly
speaking!), and because the connection layer stores the actual server
and client
information, Webrick can handle multiple browsers at the same time.

--
   Phlip
   http://flea.sourceforge.net/resume.html
7stud -. (Guest)
on 2009-04-25 10:11
Salil G. wrote:
> i would like to know how webrick recognised who's request.
>


In general, servers listen for clients to connect over a specified
pathway.  When a client connects, the server then creates a separate
unique pathway to communicate with the client, and then the server goes
back to listening for additional client connections.  If several clients
connect at the same, then there will be several unique pathways that the
server establishes to speak to each client.
This topic is locked and can not be replied to.