• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

HTTP protocol: Connection-less or Connection-based?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm now preparing SCEA exam part-1.
After I did serveral mock tests, I'm confused with the question "Is HTTP protocol connection-less or connection-based?".
Some mock tests say it is connection-less, while the other say it is connection-based.
Anybody has some idea on this question?
Thanks
 
Ranch Hand
Posts: 464
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
They are stateless protocol
I believe in HTTP 1.1 have the persistent option
Thanks
Ragu
 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Raqu is right. What might confuse you is that HTTPS is stateful whereas HTTP is not.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HTTP 1.0 uses 'Tear Down'.. the client opens and closes a socket connection for each request so is connectionless.
HTTP 1.1 uses 'keep alive'.. the client holds the socket open over multiple requests. However, this is still regarded as connectionless as it is acceptable for the client or server to drop the connection at any time and the connection will be re-established again later.
 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe that HTTP is a connection-based but stateless protocol. It is connection based because it rides on top of TCP/IP which is a connection based protocol.
Now as others have pointed out the connection is made and then closed after each request in HTTP1.0 (that still doesn't make it connection less) In HTTP1.1, there is the concept of a durable connection (using the same connection across multiple HTTP requests.)
Since the server does not inherently care if two requests came from the same client, it is a stateless protocol. We can add state by using many techniques, some of which include HTTPS (secure and stateful), or by using the HTTP Session Object and rewriting the session key with every URL / cookies e.t.c.
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree with all that is said here. However there are couple of possibilities by mixing and matching connection and connectionless layers.
I think there are lot of articles and guidelines in selecting the match according to application criteria. So coming from that angle http is a connecionless layer built on top of a connection oriented layer with the notion of servicing many clients. Similary there could be connection oriented layer somehow maintaining connection information over connectionless layer.
So categorizing a session level layer as connection or connectionless just based on the transport layer may not be right.
I think I have added some more confusion and the question that is http connection oriented or connectionless still remains ambiguous.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic