aspose file tools*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Connectionless and Connection Oriented Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Connectionless and Connection Oriented" Watch "Connectionless and Connection Oriented" New topic
Author

Connectionless and Connection Oriented

JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
Some people say that HTTP is connectionless and some people say that HTTP is connection oriented. I am confused and need clarification on this concept. Could anybody help? Thanks.
Byron Estes
Ranch Hand

Joined: Feb 21, 2002
Posts: 313
You see this alot and it can be confusing...
However, look at it logically...
The concept of connectionless HTTP does not make sense. If it never made a connection how would it send data between the HTTP client and the HTTP server? At it's very essence it's socket programming.
So...
HTTP is connection oriented and stateless.
It is stateless because information about the connection is not maintained over the course of multiple interactions between the client and the server. The client may or may not submit another request.
Some confusion also results between older versions of HTTP and HTTP 1.1. Starting with 1.1 the concept of a persistant connection was introduced to improve internet performance. In any case HTTP must create a connection for some period of time. Depending upon the implementation the connection may span multiple request/response interactions, but each interaction is COMPLETELY IGNORANT of all the other interactions.
Hope this helps...
Good Luck!
Byron Estes


Byron Estes<br />Sun Certified Enterprise Architect<br />Senior Consulant<br />Blackwell Consulting Services<br />Chicago, IL<br /><a href="http://www.bcsinc.com" target="_blank" rel="nofollow">www.bcsinc.com</a>
SPAD
Greenhorn

Joined: Jul 09, 2002
Posts: 16
HTTP is Connection-oriented and Stateless protocol.
Using the layman's example Connection-oriented is like a telephone call i.e., before you can talk you have to establish a connection i.e., TCP/IP Sockets type for HTTP. In case of connection-less think of it like a letter that you put in the post-box - if everything is fine it gets there but you don't expect an immediate response i.e., TCP/IP Datagram sockets. Now you can tell whether HTTP is connectionless or connection oriented.
Stateless - everytime there is a HTTP (1.0)request from a browser client a TCP/IP connection is established data is sent back and connection is dropped. Next request comes in the server doesn't knwo whether its related to any of the prior requests or not ... i.e., inherently there is no state being maintained by the HTTP Server. Now your argument would be what about cookies or URL re-writing ? That is an extension to HTTP protocol.
Tony Morris
Ranch Hand

Joined: Sep 24, 2003
Posts: 1608
Originally posted by SPAD:
HTTP is Connection-oriented and Stateless protocol.
Using the layman's example Connection-oriented is like a telephone call i.e., before you can talk you have to establish a connection i.e., TCP/IP Sockets type for HTTP. In case of connection-less think of it like a letter that you put in the post-box - if everything is fine it gets there but you don't expect an immediate response i.e., TCP/IP Datagram sockets. Now you can tell whether HTTP is connectionless or connection oriented.
Stateless - everytime there is a HTTP (1.0)request from a browser client a TCP/IP connection is established data is sent back and connection is dropped. Next request comes in the server doesn't knwo whether its related to any of the prior requests or not ... i.e., inherently there is no state being maintained by the HTTP Server. Now your argument would be what about cookies or URL re-writing ? That is an extension to HTTP protocol.

Correction:
In case of connection-less think of it like a letter that you put in the post-box - if everything is fine it gets there, however you "can't be guaranteed delivery of the message" (if, for example, the mail truck crashes and burns) i.e., UDP Datagram sockets.
It is important to note that TCP is a guaranteed delivery protocol, UDP is not. UDP is often used for delivery of data that doesn't need to be completely intact (such as voice, image data). This way, there is no overhead incurred of guaranteeing delivery.
Bear in mind that I have never looked at any SCEA study material in my life. This information is based purely on my own knowledge gained over the years.


Tony Morris
Java Q&A (FAQ, Trivia)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connectionless and Connection Oriented