Telnet Socket output

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
LVL 1
harvkAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
objectsConnect With a Mentor Commented:
It's not that simple, read the telnet tfc:

http://www.faqs.org/rfcs/rfc854.html
0
 
harvkAuthor Commented:
Thanks! The answer is always much easier to find than I think :)
0
 
objectsCommented:
Thanks for the points :)
0
 
jscapeCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.