This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

persistent HTTP connections

Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am trying to implement a pushlet model using servlet and I am faced with many technical difficulties to have a scalable
reliable pushlet mechanism which will do event notification to my client Applet.
My questions,
1) My Pushlet design needs a active/persistent HTTP connection through which we can have a callback
mechanism. HTTP1.1 has accomodated persistent connections , but is there any default time-out period after which the
server (weblogic6.1) drops the HTTP connection in case of client being idle for sometime ??
2)If there is timeout option should I do a ping on to server in regular intervals so as to keep the HTTP connection alive with the server. I dont want to do polling , so is there any way I can know the default HTTP time-out option of the server so
that I can do a ping within that interval to keep Connection alive.
3) I cannot use plain persistent Sockets (TCP/IP) because of firewall between client and server ,
Is there anyway I can keep my HTTP-Connection alive with server avoiding the default HTTP-Timeout taking into consideration that
webserver supports HTTP1.1
Any information on these will be of great help and will be appreciated..
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is something about TCP KEEP_ALIVE, hopes that will help.
You can turn on the SO_KEEPALIVE option in Socket with jdk1.3 or later by using setKeepAlive(true) on the client side. It'll result int the following consequence:
Every two housrs, the client sends a TCP packet to the Server. If there is proper response (if during the two hours, the server has been restarted, the server will respond to the packet with RESET, which forces the client to close the connection), client will try again two hours later.
If there is no response, the client will send 9 packets over the next period of time with an interval of 75 seconds. If no response is found, the client will close the connection. If there is a proper response, go back to the stage of sending a packet two hours later.
if you think brussel sprouts are yummy, you should try any other food. And this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!