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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T13:56:36+00:00 2026-05-20T13:56:36+00:00

In the process of building a P2P app for a class, I start a

  • 0

In the process of building a P2P app for a class, I start a number of peers from an ant build file before starting one in “interactive” mode.

The ant docs on the task states that one can interact with a forked app since ant-1.6.3

The code to read input is:


while (true) {
                System.out.println("> ");
                BufferedReader br = new BufferedReader(new InputStreamReader(
                        System.in));
                String cmd = "";
                try {
                    cmd = br.readLine();
                    System.out.println(cmd + "hier");
                    if (cmd == null)
                        continue;
                    if (cmd.equals("hello")) {
                        System.out.println("Port: ");
                        int bsPort = new Integer(br.readLine());
                        System.out.println("IP (blank for localhost): ");
                        String bsIp = br.readLine();
                        if (bsIp.equals(""))
                            bsIp = "127.0.0.1";
                        bootstrap(bsIp, bsPort);
                    }
                    else if (cmd.equals("plist")) {
                        plist();
                    }
                    else if (cmd.equals("nlist")) {
                        nlist();
                    }
                    else {
                        System.out.println("Command was read as: " + cmd);
                    }

                } catch (IOException ioe) {
                    System.out.println("IO error trying to read your command!");
                    System.exit(1);
                }

The relevant ant task is:

The ant task can apparently not be shown by SO, but it’s basically a java fork=”false” block.

Of note is that I run the root and subsequent peers in parallel -> daemons blocks to get them to run in the background. Those are forked.

I have tried with fork=”true” and fork=”false” (finding a link that said to set it to false) – both to no avail.

I have found one link saying that I can use a TimedBufferedReader, but am a bit wary to do so only to please ant…

  • 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-20T13:56:37+00:00Added an answer on May 20, 2026 at 1:56 pm

    Seems the daemon tasks hijacked System.in. Setting an inputstring=”” argument on those did the prevented them from doing so, and let me interact with the interactive client.

    Just to let others know, if one outputs via System.out.print instead of System.out.println, one will not see the output before after having given the input…

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

Sidebar

Related Questions

During the process of building software applications, you would start testing what you have
We're in the process of building a MOSS site and one of the 3rd
Im building a web application which is a process management app. Several different employee
I'm in the process of building an app related to healthcare IT. My company
I am in the process of building my first iPhone app (xCode,objective-c) which has
I'm in the process of building a sports team app and have created my
I am in the process of building a Rails app that will hook into
I am in the process of building a facebook app that works through iFrame
We are in the process of building a Multi-Tenant, SaaS type web app. Everything
I'm currently in the process of building out a VERY simple Observer class for

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.