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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:28:37+00:00 2026-06-13T06:28:37+00:00

I am using old school java.net.Socket My client connects to server and does: BufferedReader

  • 0

I am using old school java.net.Socket

My client connects to server and does:

BufferedReader in =
   new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
String fromServer = in.readLine();

It hangs at in.readLine().

My server accepts a connection from the client and does:

PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
out.print("Hello client\n");

My expectation would be that as soon as out.print(“Hello client\n”); is invoked, the client should stop blocking and continue on.

What are my doing wrong?

PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true);
BufferedReader in =
   new BufferedReader( new InputStreamReader(clientSocket.getInputStream()));
String fromServer = in.readLine();
  • 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-13T06:28:38+00:00Added an answer on June 13, 2026 at 6:28 am

    I guess you are not calling out.flush(); See PrintWriter.flush

    From Javadoc

    autoFlush – A boolean; if true, the println, printf, or format methods will flush the output buffer

    So Autoflush will not work for print you will need to call flush() mannually

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

Sidebar

Related Questions

We are trying to convert out old school client server application into a N-Tier
I am using old good RichEdit control with last version of VB.NET I want
I am busy converting a query using the old style syntax to the new
I have been old school using mysql_query and starting out now using PDO. Which
I'm converting an old school Java filter to a Grails filter. (The filter is
Using 'old school' javascript you would put the ID as the parameter in an
I'm using Entity Framework 4.1 (database first, e.g old school), and i'm using POCOs
I am using plain old school Javascript - So no jQuery responses please!. I
So I've been using QBASIC64 today... for old school's sake. I was wondering: a)
I'm using old php script that depends on session_register to gives warning messages but

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.