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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:10:02+00:00 2026-06-13T21:10:02+00:00

I am executing the following code and always get an EOFException in urlConnection.getInputStream(). I

  • 0

I am executing the following code and always get an EOFException in urlConnection.getInputStream(). I know that the webserver is not returning proper headers, but if I use the same url in a web browser I get the expected content back.

URL url1;
try
{
    url1 = new URL("http://63.255.173.242/get_public_tbl.cgi?A=1");
    HttpURLConnection urlConnection = (HttpURLConnection) url1.openConnection();
    try 
    {
        InputStream in = new BufferedInputStream(urlConnection.getInputStream());
        readStream(in);
    }
    catch(Exception e)
    {
        e.printStackTrace();
    }
    finally
    {
        urlConnection.disconnect();
    }
}
catch (MalformedURLException e)
{
    e.printStackTrace();
}
catch (IOException e)
{
    e.printStackTrace();
}

Any ideas?

Edit 1:

I thought I was on to a possible solution. I found that using Android 2.3 I can read the response by calling getHeaderFields() (even though there is no header), but if I use Android 4.1 getHeaderFields() returns null. Any ideas?

url1 = new URL("http://63.255.173.242/get_public_tbl.cgi?A=1");
URLConnection urlConnection = url1.openConnection();
Map<String, List<String>> fields = urlConnection.getHeaderFields();
  • 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-13T21:10:03+00:00Added an answer on June 13, 2026 at 9:10 pm

    As your server is not talking proper HTTP you cannot use URL.openConnection, but you can still access it using a plain socket connection to 63.255.173.242 port 80 and sending the strings:

    GET /get_public_tbl.cgi?A=1 HTTP/1.0\r\n
    \r\n

    and then reading the resulting stream.

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

Sidebar

Related Questions

I'm finding it difficult to get started in Objective-C. I'm executing the following code
I get an exception while executing following piece of code bool FieldValueMessage::Get(const std::string &field,
The following code is executing perfectly but there is a mySQL error somewhere that
I have the following code and it seems to me that it should always
I get a MediaException (Prefetch error: -5) when executing the following code on a
When executing the following code: OpenFileDialog dialog = new OpenFileDialog(); DialogResult result = dialog.ShowDialog();
I am executing the following code to install SQL Server 2012 in silent mode.
If I try executing the following code f = file('test','rb') fout = file('test.out','wb') for
I am executing the following code: def takeN(s : String, n : Int): String
I am getting Incorrect syntax near the keyword 'select' after executing the following code.

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.