• Post Reply Bookmark Topic Watch Topic
  • New Topic

automating a telnet session  RSS feed

 
Christopher Arthur
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm new to socket programming and I'm trying to write a program that will automatically log on to a telnet service and get some information. I've gotten as far as to open up a connection and receive data with a DataInputStream, but I'm having problems kind of syncronizing the sending and receiving. The thing is, this service is picky. You can't send it a command until it is good and ready, so I'm wondering if there is some general way to know when a service is finished sending data and waiting to receive, and also, it wants to know what kind of terminal I'm pretending to use, and I don't know what to tell it. Does someone have some example code that would show how to interact with a telnet service? I would appreciate it.

Regards,

Chris Arthur
 
Mattias Arthursson
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unless you're doing this just for fun, I would recommend that you use some external library for this, e.g. Jakarta Commons Net
 
Christopher Arthur
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mattias, the Commons Net library looks like a good resource. It's a good thing that its JAR is only 150k, too.

Chris
 
Van Glass
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another tool you may wish to consider is here

http://www.jscape.com/sshfactory/

has tools and a scripting language for automating telnet and ssh tasks.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!