Solved

Telnet Socket output

Posted on 2001-08-02
4
236 Views
Last Modified: 2008-03-06
I have a Socket() on port 23. I get the DataOutputStream and am ready to write. I want to send messages just like typing them over a telnet terminal or console.

I have tried the writeChars() method and the writeBytes() method, but no good. What should I do? Also, should the string to be sent be "message" or "message\n" or "message\r"?

Thanks
0
Comment
Question by:harvk
  • 2
4 Comments
 
LVL 92

Accepted Solution

by:
objects earned 100 total points
ID: 6344054
It's not that simple, read the telnet tfc:

http://www.faqs.org/rfcs/rfc854.html
0
 
LVL 1

Author Comment

by:harvk
ID: 6344198
Thanks! The answer is always much easier to find than I think :)
0
 
LVL 92

Expert Comment

by:objects
ID: 6346605
Thanks for the points :)
0
 

Expert Comment

by:jscape
ID: 9752560
you usually have to perform option negotiation before you can send any data

see the following article

http://www.jscape.com/articles/telnet_using_java.html
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Android studio getdrawable(int) is deprecated 4 121
ejb example issues 3 28
Java: anonymous class 4 29
Setup GlassFish 4 22
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
The viewer will learn how to implement Singleton Design Pattern in Java.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question