Apache Ant Telnet Task
Ant Telnet task is used to provide bidirectional text oriented communication facility. It is a network protocol. By default Apache Ant does not support it. So, we need to include a external JAR commons-net.jar file into classpath.
This task is mainly used to automate telnet session xml file.
The <telnet> element supports nested elements <read> and <write>to perform read/write operations respectively.
Apache Ant Telnet Task Attributes
Let's see some example to understand the telnet task.
Apache Ant Telnet Task Example
The above example is a simple telnet connection program which connect to localhost by mapping provided userid and password.
During connection, we can also set connection timeout period.
Specify Port Number