|
Sending data
|
|
| In the last line of the example above a \n was sent after the ls al command. This is required to let the server know that the client has finished sending data. If you do not send a \n then the server will continue blocking I/O and will not respond until a \n has been received. Depending on the server you are communicating with a \r\n may be required.
|
|
|
| An alternative to manually sending the \r\n is to use the TelnetOutputStream#println method. The object returned when invoking the Telnet#getOutputStream method is of type java.io.OutputStream but may be cast to a TelnetOutputStream.
|