Solved

Telnet Socket output

Posted on 2001-08-02
4
231 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
Comment Utility
It's not that simple, read the telnet tfc:

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

Author Comment

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

Expert Comment

by:objects
Comment Utility
Thanks for the points :)
0
 

Expert Comment

by:jscape
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
powerN  challenge 3 47
ArrayLists in ArrayLists/HashMaps? 4 39
Running Jira on Raspberry PI 2? 3 121
solarwind tftp server 2 30
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
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 about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now