# How webrick works

**URL:** <https://www.ruby-forum.com/t/how-webrick-works/166436>\
**Category:** Rails\
**Created:** [April 25, 2009, 6:43am UTC](https://www.ruby-forum.com/t/how-webrick-works/166436 "2009-04-25T06:43:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![salil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c89c15/32.png) [@salil](https://www.ruby-forum.com/u/salil)\
**Post date:** [April 25, 2009, 6:43am UTC](https://www.ruby-forum.com/t/how-webrick-works/166436/1 "2009-04-25T06:43:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![salil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c89c15/32.png) [@salil](https://www.ruby-forum.com/u/salil)\
**Post date:** [April 25, 2009, 7:11am UTC](https://www.ruby-forum.com/t/how-webrick-works/166436/2 "2009-04-25T07:11:22Z")

</div>

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](https://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](http://flea.sourceforge.net/resume.html)

---

<div class="post-metadata">

**Author:** ![salil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c89c15/32.png) [@salil](https://www.ruby-forum.com/u/salil)\
**Post date:** [April 25, 2009, 8:11am UTC](https://www.ruby-forum.com/t/how-webrick-works/166436/3 "2009-04-25T08:11:23Z")

</div>

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.
