Telnet client

J

Jani Jalkala

I'm trying to build a telnet client with Java. I have found full
applications with open source from the web, but I'd like to code my own
thing from scratch so that I can learn from the process instead of copying
code without fully understanding what it does. This link provided some good
information for me:

http://utenti.lycos.it/yanorel6/2/ch31.htm

It works, but the application performs quite slow (makes DSL feel like 2400
modem). So if anyone could point me to the bottleneck, that would be much
appeciated. I'm guessing that it is something in the implementation of
NVTInputStream class, but I don't want to spend too much time investigating
what it could be.

Thanks,
Jani
 
A

Andrew Thompson

I'm guessing that it is something in the implementation of
NVTInputStream class, but I don't want to spend too much time investigating
what it could be.

If you don't, why should we?
 
J

Jani

What I was trying to ask was of course that if someone happened to know the
answer right from top of their head, without any closer inspection or
debugging of the code. If you don't know, then you've already spent more
time on this than you should have. Sorry about that.
 
E

Esmond Pitt

For telnet I would suggest that you should set the Nagle algorithm off.
You should use a BufferedInputStream around Socket.getInputStream() and
a BufferedOutputStream around Socket.getOutputStream(), flushing the
output whenever you have sent a complete Telnet command or a piece of
user input - try to avoid writing just one character at a time. You
should also use two separate threads for socket input and output.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top