File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Sockets and Internet Protocols and the fly likes Cannot connect to telnet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Cannot connect to telnet" Watch "Cannot connect to telnet" New topic

Cannot connect to telnet

Alan Blass
Ranch Hand

Joined: Mar 21, 2010
Posts: 146

I am trying to connect via telnet. I have specified the IP addres and the port number.

telnet.connect(<ipaddress>, <portNumber>);

But I get Connection refused: connect

But I can connect using putty using the same ip address and port.

How can I troubleshoot the java connection refused error?

Joe Ess

Joined: Oct 29, 2001
Posts: 9168

Putty can be used for both SSH and Telnet. Are you trying to telnet to the SSH port?

[How To Ask Questions On JavaRanch]
wood burning stoves
subject: Cannot connect to telnet
It's not a secret anymore!