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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:31:23+00:00 2026-05-24T23:31:23+00:00

After connecting to server, I run some commands on server and then trying to

  • 0

After connecting to server, I run some commands on server and then trying to take the server knowledge to console with;

while(i!=-1){
                String c="";
                String line = "";

                    try {
                        while ((i = input.read()) != 10 && i!=-1) {
                            bx[0] = (byte) i;
                            c = new String(bx);
                            line = line + c ;
                            System.out.print(c);
                        }
                    } catch (IOException e2) {
                        e2.printStackTrace();
                    }   
                    File outfile = new File("calltrak.txt");
                    boolean append = true;
                    try
                    {
                        if (!outfile.exists())
                        {
                            append = false;
                        }
                        FileWriter fout1 = new FileWriter("calltrak.txt",append);
                        PrintWriter fileout = new PrintWriter(fout1,true);
                        fileout.println(line);
                        fileout.flush();
                        fileout.close();
                    } catch (IOException e1) {
                        e1.printStackTrace();
                    }
                    disp.append(line);
            }

But the problem is when the program read all lines from server windows, in server it waits to new input and my prog still tring to read the line and so it locked… How can I solve this problem… (Note:Using a timer isn’t a way to solve because the lines which the program read can be 100 line or 100000 and sometimes server can work slow) (In the code “disp” is Jpanel name)

  • 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-24T23:31:23+00:00Added an answer on May 24, 2026 at 11:31 pm

    I solved this problem with using paralel thread. With starting Inputstream read method I also started another thread and put inside of it a timer.If read method wait more than 5 seconds, other thread sen -1 to first loop and so loop terminated.

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

Sidebar

Related Questions

I have some problem while configuring symfony project on the production server. When I
Summary: I'm having some svn trouble, and after debugging it for a while, I'm
I am having problems with SQL Server dropping a connection after I have dropped
I have a class that gathers templates and displays the final output after connecting
I'm collecting latitude and longitude from Mobile Safari with some JavaScript code. After collecting
I'm trying to run a PHP script which has pg_connect($connection_string) and it just crashes
Let's say I have a server listening on port 1234. I have some client
I have ImageMagick installed on my CentOS linux server. I am trying to get
I have created a linked-server definition according to the article at : http://www.ideaexcursion.com/2009/01/05/connecting-to-oracle-from-sql-server/ My
I just got knocked down after our server has been updated from Debian 4

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.