Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7458459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T13:27:00+00:00 2026-05-29T13:27:00+00:00

I have a Tomcat 7 servlet accepting connections from remote clients, and keeping those

  • 0

I have a Tomcat 7 servlet accepting connections from remote clients, and keeping those connections open for hours or days if possible. So, we are using the NIO connector.
The bandwidth on the physical connections may be expensive, so traffic is to be kept to an absolute minimum, therefore we have programmed the remote clients to test the connection with a very infrequent ping.

Occasionally, the servlet is told the connection is closed, but it seems that the remote clients are not told. The clients don’t find out until they do a ping, at which time they can establish a new connection. We need to reduce the length of time the clients are not connected, without using more pings.

One way that works is to shut down the Tomcat server. The clients know they are disconnected immediately. Obviously we don’t want to be shutting down Tomcat – my point is there must be some kind of signal making it across the normally-quiet connection.

How can I force Tomcat to send this signal? Please don’t respond that I can’t unless you can tell me why, with specifics, partly because I can’t believe it, and mostly because I don’t want to believe it. It seems strange – like not being able to hang-up the phone on someone.

Alternate question #1 – can a servlet recover a connection it has been told is closed?

Alternate question #2 – can anyone think of anything else that might help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T13:27:01+00:00Added an answer on May 29, 2026 at 1:27 pm

    A couple of thoughts:

    • I’m surprised the clients are unaware that the connection has been dropped. Are you certain that an exception is not being swallowed somewhere client side?
    • With days long connections, I’d start to look at what is happening on the TCP layer. You’ve not mentioned any diagnostic or information…
      • Have you attempted to determine if the there is an underlying TCP/IP connection still present for these problem client/server connections?
      • How stable is the network between client and server?
      • Are their potentially misbehaving network devices, like proxies or routers involved?
    • I don’t really see the benefit of using the NIO connector in this context of long lived connections. Many requests per second? Yes. But just for long lived connections? No.
      • In the past I’ve had a bizarre issue with the NIO connector and a servlet protocol gateway (OpenAMF) that magically went away by using the default HTTP connector.
      • Test the other two connectors (HTTP, native ARP), benchmark them.
    • I would also consider ditching any TCP-based protocol (like HTTP) in favor of some UDP-based approach. That way your connections would be state-less and, with a bespoke tuned payload, the packets very small.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a tomcat servlet 1 running under the ROOT: api1.myhost.com:8080/ I'm using
I'm using Tomcat as a servlet container, and have many WARs deployed. Many of
I am using Tomcat 7 as a servlet container and I have two war
I have Apache Tomcat Version 7.0.26 running. A have a JAX-RS servlet under /test,
In tomcat 6 i have a servlet running openbluedragon, everything compiles and servers up
I have a legacy Java servlet that is currently running in a Tomcat container.
I am running Tomcat 5.5.4 and have a servlet running with no problems. However,
I have two web applications running in same Servlet container ( Tomcat ), A
I have a simple tomcat servlet application, no Java EE. Also, I am running
I'm trying to send plain text error messages from a tomcat servlet, so that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.