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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:10:02+00:00 2026-06-08T11:10:02+00:00

I have a code where I need to capture some information from a equipment.

  • 0

I have a code where I need to capture some information from a equipment. This equipment have a socket connection. Basically is this:

I send a command a have this returned:

<some info>
<some info>
<some info>
<some info>

1.551
1.689
... (A bunch of those numbers)
1.258

<more info>

I need part of the but is trash for me.

Fisrt Attempt was:

read <somne info>
reached empty line?
start getting the points
reached the points total amount?
break the loop

This kind of work. Sometimes for some reason, the next read I do on the socket (sending a command and expecting a single line answer) gives me some trash from this socket read. Bu just sometimes.

I tried to do this:

read <somne info>
reached empty line?
while !EOF
    is number?
    read
end

So. This read everything I need. But when reaches the end gives me a IOException: red timeout

I know there’s nothing left for reading, so How could I avoid that?

Sorry, I don’t have the actual code right no with me, but basically this is the problem: getting a exception with read timeout in the end of this loop:

while((line = readLine()) != null){
      //read stuff
}
  • 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-06-08T11:10:04+00:00Added an answer on June 8, 2026 at 11:10 am

    I couldn’t find an easy solution for this problem.

    What I did was to insert a try/catch block inside reading block. So, When I finish reading the points, I go to that try/catch block which reads until EOF. Since there’s no EOF, it throws an IOExcpetion (Read Timeout) witch I cactch, ignored it. And go on.

    I know it’s not the best solution, but s what is working right now.

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

Sidebar

Related Questions

I am converting some code from Perl into .NET. I have this s/// pattern
I have a code that need to be translated from C to Cpp, and
I have this code and I need to make this work: if ($handle =
I have code that does a web-service request. While doing this request I need
If I have code with nested objects like this do I need to use
I have this unsafe code that I need to make safe so it can
I have some code to execute the unix shell command in background in python
I have this little code to capture text between brackets: $string = '[title=my title]
i have the following code ..i need to loop through end of the file
I have existing java code and need to create Design Document based on that.

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.