Solved

Telnet Socket output

Posted on 2001-08-02
4
234 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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Groovy problem when using SOAPUI : DispatchException occurred 7 45
Java string replace 11 48
Java: anonymous class 4 22
Java syntax, or is it Selenium 6 13
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
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…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

809 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