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

  • Home
  • SEARCH
  • 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 6244419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:19:24+00:00 2026-05-24T12:19:24+00:00

im using guava and weberknecht to convert an inputStream to a string and connect

  • 0

im using guava and weberknecht to convert an inputStream to a string and connect to a websocket [see this post]. Weberknecht threw me out, so im trying a very simple Socket-Connection to get any answer from the server. The Problem is, i can’t read the inputStream. I don’t know why.

NOTE:
On Iphone the Websocket-Server works. [i know “websocket /= socket” … im just trying everything here to get ANY answer from the server]

My code:

        try {
            Socket sock = new Socket("62.212.88.234", 15000);
            OutputStream out = sock.getOutputStream();
            InputStream in = sock.getInputStream();

            Log.e("SKT", "Reading input [! PROBLEM HERE !]");
            String string = CharStreams.toString(new InputStreamReader(in,
                    "UTF-8"));

            Log.e("SKT", "Answer [! NEVER REACHED !]:" + string);
            sock.close();

        } catch (UnknownHostException e) {
            Log.e("SKT", "UnknownHostException: " + e.getMessage());
        } catch (IOException e) {
            Log.e("SKT", "IOException: " + e.getMessage());
        }

Thanks for the Help in advance.

  • 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-24T12:19:24+00:00Added an answer on May 24, 2026 at 12:19 pm

    The documentation for CharStreams.toString says:

    Reads all characters from a Readable object into a String.

    My guess is that the remote end does not close the socket, so there’s no end-of-stream to consume, thus the freeze.

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

Sidebar

Related Questions

Can I easily convert InputStream to BufferedReader using Guava? I'm looking for something like:
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
I'm using Guava-05-snapshot, with Sun's JDK 1.6 The code blows up executing this snippet:
Using linq2sql I'm trying to take the string in txtOilChange and update the oilChange
I am trying to get a date range using Guava's new Range functionality, via
what is the simple way to do lexicographical ordering of string list using guava.
I am trying to join int[] (array of int) using Google Guava's Joiner class.
I was using com.google.common.collect.PrimitiveArrays from Google Collections, however I cannot find it in Guava,
Is there a way of achieving the below using Guava? //anything better than using
In our applications we are using property files very much. Since a few months

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.