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 7367843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:35:19+00:00 2026-05-29T03:35:19+00:00

I am using ServerSocket in my java application and it will be listening to

  • 0

I am using ServerSocket in my java application and it will be listening to port 1111. When the client connects to the port each client connection will be executed in separate Thread. Each connection will receive data for every 1 minute until the connection is closed.

The question is, suppose if the client connection doesn’t receive any data for more than 10 minutes some event should be triggered and the important thing is connection should remain unclosed. So that i can use that event to execute an mail alert to me.

Is there any technique to do this?

  • 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-29T03:35:19+00:00Added an answer on May 29, 2026 at 3:35 am

    You can implement a Listener or Observer Interface. Here is the algorithm. Create a Thread, eg., ClientMonitor which polls a flag in the client object. You can also use a TimerTask to poll the flag/object at specified time intervals

    1. Start a new TimerTask to monitor the client
    2. Check if the client has received any data in last ten minutes.
    3. If yes, then reset the TimerTask .
    4. If no, then raise an Exception, which will take care of executing the mail alert while the connection to the client remains open.
    5. Reset the TimerTask
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a simple http client server using java. It will show
My java code use several threads, each thread run a ServerSocket and goes in
I am implementing a server using Java ServerSocket and have two clients connecting, each
Hey all. I have a server written in java using the ServerSocket and Socket
I'm implementing a java TCP/IP Server using ServerSocket to accept messages from clients via
I am using java sockets for communication. On the client side I have some
I'm trying to build a simple HTTP Server using Java, using java.net.ServerSocket = new
I am trying to write an FTP client using java. As far as I
In Java, what would the best way be to have a constantly listening port
I have a client-server application. The server is pure Java, the client is an

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.