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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:45:23+00:00 2026-05-18T20:45:23+00:00

I’ve recently started messing around with Java sockets and telnet… I want the user

  • 0

I’ve recently started messing around with Java sockets and telnet…

I want the user to be able to connect to the server, just type a letter and have it sent to the server, without pressing enter to send it. I’m sure there’s no way for the server to set this up, but maybe telnet has a parameter or something which could allow this?

Maybe if I got the user to type stty cbreak or stty raw before running telnet, this would work? (UNIX only, I know!)

If I can get telnet to do this then it saves me having to write a special client just for this feature…

  • 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-18T20:45:23+00:00Added an answer on May 18, 2026 at 8:45 pm

    You should be able to do this with telnet option negotiation. The protocol defaults to half-duplex mode, and at a minimum for an interactive session, the server should negotiate the suppress go ahead option and echo option.

    At the bare minimum you could just spit out ff fb 01 ff fb 03 (will echo, will suppress-go-ahead) at the begining of the session, then reply to any ff fd 01 (do echo) with ff fb 01 (will echo) and reply to any ff fd 03 (do suppress-go-ahead) with ff fb 03 (will suppress-go-ahead).

    Edit to add that the linemode negotiation mentioned by Ben Jackson is a better answer. Suppress go-ahead won’t be enough for most clients connecting on ports other than 23.

    However I think the other problem you’re running into is that Java is sending Unicode characters. For example, when you say (char)0xff, Java assumes you’re referring to UTF-16 character U+00ff which is ÿ. It’s probably sending it over the socket using UTF-8 encoding, so the telnet client sees two bytes: c3 bf which it passes on and displays as ÿ.

    What you can do is explicitly tell Java to use ISO-8859-1 encoding. For example, you may have been doing something like this before:

    out = new PrintStream(connection.getOutputStream());
    out.print((char)0xff);  // sends 0xc3 0xbf
    out.print((char)0xfb);  // sends 0xc3 0xbb
    out.print((char)0x01);  // sends 0x01
    out.flush();
    

    Instead, you can use the OutputStreamWriter to specify the encoding you want:

    out = new OutputStreamWriter(connection.getOutputStream(), "ISO-8859-1");
    out.write((char)0xff);  // sends 0xff
    out.write((char)0xfb);  // sends 0xfb
    out.write((char)0x01);  // sends 0x01
    out.flush();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.