Link to home
Start Free TrialLog in
Avatar of Kostas Harvatis
Kostas HarvatisFlag for Greece

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Kostas Harvatis

ASKER

Thanks! The answer is always much easier to find than I think :)
Thanks for the points :)
Avatar of jscape
jscape

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