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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:13:50+00:00 2026-05-24T13:13:50+00:00

I am building a simple telnet connection daemon for communications between internal network applications,

  • 0

I am building a simple telnet connection daemon for communications between internal network applications, and I ran into an issue when reading the first line from BufferedReader.

This code snippet is not complete due to the fact there is a lot of other junk in there so I have stripped it down only to include the object creation and read from the steam.

in = new BufferedReader(new InputStreamReader(this.client.getInputStream()));
out = new PrintWriter(this.client.getOutputStream(), true);
String line;

while (true) {
    out.println(flag); // flag is just an integer               
    System.out.println(line);
    // Processing the line and updating 'flag' accordingly
}

Entering test into the telnet connection yielded  v? v  v? v' ²? v? ²?test in the console that was running the program. This does not happen to lines sent after the first one.

Is there a way to clear that garbage out before the user interfaces with it so it doesn’t get sent with the first line? or is this issue caused by my telnet client (and might be fixed when I write a client that interfaces with this)?

  • 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-24T13:13:50+00:00Added an answer on May 24, 2026 at 1:13 pm

    I strongly suspect it’s the telnet protocol negotiation. Ideally, you should handle it having read RFC 854 carefully.

    Note that you shouldn’t just use InputStreamReader without specifying the character encoding – it’s very unlikely that the platform default encoding is the one you want.

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

Sidebar

Related Questions

I'm building a simple java Servlet which passes categories using a URL variable into
I'm building simple http status checker in C. I've got the network part done,
I'm building a simple live chat into a web application running on Django, but
I'am building simple Ajax application (via jquery). I have strange issue. I found where
I am building a simple PHP daemon script, using a php Daemon class provided
I'm just building a simple ajax site but running into a problem in safari
I'm building a simple Todo List application where I want to be able to
I am building a simple Django app that will use scribd to display documents.
I'm building a simple ASP.NET web application in VS 2008 with a SQL 2005
I'm building a simple ice sliding puzzle to test uses of allegro. So far

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.