This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes is HTTP is connection oriented Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "is HTTP is connection oriented" Watch "is HTTP is connection oriented" New topic
Author

is HTTP is connection oriented

Sudarshan Muramreddy
Greenhorn

Joined: Jun 08, 2004
Posts: 16
Hi All,
I am really confused to decide weather HTTP is a Connection oriented(I though may be this is based on TCP ,which is connection oriented) or is just connection less can any once clarify this please.

Thanks,
Sudarshan
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
Welcome to the Ranch Sudarshan!

It's connectionless because requires a new connection for each request. That is, it doesn't maintain a single connection for the whole communication between client and server.
[ June 08, 2004: Message edited by: Jose Botella ]

SCJP2. Please Indent your code using UBB Code
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
This is interesting and confusing for a couple reasons.

For one, we often talk about web server sessions. The server maintains some state and remembers the user and what they're doing and that sounds a lot like the definition of a connection. The distinction is that web servers build their session stuff on top of the HTTP protocol, and session is not part of the HTTP protocol. You can have HTTP servers with no sessions.

Another confusing bit is that IP is connection oriented. HTTP makes an IP connection for the duration of one HTTP request-response and then breaks it. If you read up on HTTP there is a three part handshake - three IP messages - to one request. I'm foggy on this but it's something like
Client: I'd like to send you a message
Server: Ok, send me a message
Client: Here's the message.

I think it's cool that we run connection oriented web sites over connectionless HTTP over connection-oriented IP over connectionless TCP. Protocol stacks can be fun.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Sudarshan Muramreddy
Greenhorn

Joined: Jun 08, 2004
Posts: 16
Thanks guys ...Now i am clarified
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
IP is connectionless and TCP is connection oriented.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Thanks, Jose. I passed my networking class, but instantly forgot most of it.
tommy k. lee
Greenhorn

Joined: Jun 16, 2004
Posts: 20
Based on the OSI 7-layers model, HTTP is an application layer protocol. (layer 7). It uses IP and TCP (layer 3 and layer 4) protocols as its transport. It does NOT support UDP.

Since HTTP uses TCP, it is therefore connection-oriented.

However, what confuses most people is that each web page requests opens multiple HTTP connections to the web server. For instance, if a web page has 5 images, the web browser will likely open 5 different HTTP connections to the web server. After each image is delivered, the connections are closed one-by-one.

This is based on the request-response nature of HTTP. Even though HTTP connections are opened and closed rapidly, the HTTP protocol is connection-oriented since it uses TCP.


SCJP,SCJD SCEA, SCWCD, SCBCD<br />OCP DBA 8i / 9i<br />CISSP, PMP, PHR<br />CCNA, CCDA <br /><a href="http://www.certgear.com" target="_blank" rel="nofollow">http://www.certgear.com</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: is HTTP is connection oriented
 
Similar Threads
HTTP and concept of connectionless
Is HTTP connectionless or connection oriented
HTTP protocol: Connection-less or Connection-based?
HTTP is connection-less or connection-base? my materials tell me difference answer:(
HTTP and concept of connectionless