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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:57:32+00:00 2026-05-31T22:57:32+00:00

Currently, I have a while loop for listening the port. When a socket accepta

  • 0

Currently, I have a while loop for listening the port. When a socket accepta a connection, a Task, which implements a runnable interface will be created, and is assigned to the LinkedList named o_allTaskThreads to store it. That is to let me have control, to stop them.

                s = this.o_ServerSocket.accept();
                System.out.println("connection established");

                PortListenTask plt = new PortListenTask(s,this.o_config);
                this.o_allTaskThreads.add(plt);
                plt.run();

But I got some problems here, if the PortListenTask is done/finished or have exception terminaled, it can’t update the linkedLIst o_allTaskThreads, how can I solve it? Thanks.

  • 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-31T22:57:34+00:00Added an answer on May 31, 2026 at 10:57 pm

    When the PortListenTask’s run() method ends (normal execution completes), can it not update the linked list (I assume to remove itself) then? If you add a try / catch handler around the contents of your run() method then hopefully you can trap abnormal situations and help guide them through the same clean exit. You should always try and signal a thread to exit itself, rather than abort them externally, to allow such a clean exit.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a while loop, which contains an if statement: if (s.Contains(mp4:production/CATCHUP/)) Although
I currently have a application which will display the time allocated to a user
I have a workflow, which creates a task and deletes it after the task
I have a receive thread listening with the BluetoothServerSocket accept() call. This thread will
I have a while loop that goes through a table and I echo the
I have a while loop that I use to echo multiple mysql results that
I currently have the following loop: do { checkedWord = articleWords.Dequeue().TrimEnd('?', '.', ',', '!');
I've had a tumblr account for a while and currently have an outdated theme.
I have a while loop i wish to escape when i hit the number
I currently have the following code: while not (sqlMailMergeData.Eof) do begin if sqlMailMergeData.FieldByName('Email').AsString <>

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.