From the Net::Telnet docs
Other reasons to use this module than strictly with a TELNET port are:
* You're not familiar with sockets and you want a simple way to make client connections to TCP services.
* You want to be able to specify your own time-out while connecting, reading, or writing.
* You're communicating with an interactive program at the other end of some socket or pipe and you want to wait for certain patterns to appear.
max_buffer_length allows you to set the input buffer size, default is 1MB
timeout can be set to undefined to turn off timeout
I have found the documentation to be good and the module to be flexible
Jim
| [reply] |
Some experimentation with different ways of getting the input has shown me that Net::Telnet seems to be able to buffer the data coming in over the socket sufficiently that I haven't lost any in my tests. I guess I just needed someone else to reassure me that it would work.
However, I am still curious as to *how* it works...
What I've got so far is this: The input is data sent from the remote host and the output is the data my app sends to the remote host. My app uses Net::Telnet to retrieve the input lines and send the output lines. The documentation says that all output is flushed while all input is buffered. What I don't understand is how the buffering happens - is that something a socket does behind-the-scenes? Because if Net::Telnet is doing the buffering I want to understand how the code is executing - I *know* that input is coming in while my app is processing, between calls to Net::Telnet's readline() method.
Still, my second shot at this module is shaping up to be much, much better code without the threads.
| [reply] |
| [reply] |