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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:31:50+00:00 2026-05-31T16:31:50+00:00

I haven’t got any code at the moment but I have a situation where

  • 0

I haven’t got any code at the moment but I have a situation where I will be implementing an Java application onto a wireless sensor. There can only be one main method.

There will be multiple other wireless sensors that can connect to my sensor. My sensor needs to do a calculation based on thhe information provided to me by the other sensors. Each sensor can choose whether or not they want to participate in the calculation. Every 1 second, my sensor does a calculation.

So basically, what I need is to listen for incoming sensors, provide them with a thread to interact with, and retrieve the information from each sensor.

My question is, in my application, how do I listen for incoming sensors (blocking call) and also free my application to carry out its calculations?

  • 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-31T16:31:51+00:00Added an answer on May 31, 2026 at 4:31 pm

    From a high level, this is what your application will do

    ==Main Thread==

    1. start socket
    2. Start processing thread
    3. accept an incoming connection (this will cause the thread to block until a connection occurs)
    4. start new thread to handle socket (handler thread) (alternatively use a thread pool, but that is more complicated)
    5. return to 3

    ==Handler Thread==

    1. Receive open socket from main thread
    2. Save data coming in from socket to be given to processing thread
    3. Finish and close socket

    ==Processing Thread==

    1. Wait 1 second
    2. Process data retrieved from step 2 of Handler Thread
    3. Return to 1
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I haven't found any documentation on this or seen this done before, but is
Haven't seen anything, but I have seen that you can create albums in the
Haven't seen anything about it here but it seems to solve one of the
I haven't browsed through the spec, though I doubt any info is in there.
I haven't touched Java since using JBuilder in the late 90's while at University,
I haven't found any references to apps that use a custom activity indicator --
I haven't been able to find any documentation on Android's sync services, so far
I haven't been able to get any more console output (to help with debugging)
I haven't been able to find any real documentation on this, so I'm wondering
I haven't actually done this yet, and maybe I don't need to, but it

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.