Telnet 服务器
系统连续多次尝试远程登录到服务器。 尝试 telnet 的进程是否有可能因缓冲区溢出而崩溃? 我的情况是一个循环中的 Perl 程序在 10 秒内尝试打开 telnet 连接并关闭 500 次。
A system is trying to telnet to a server a number of times continueously. Is there a possiblity that the process trying to telnet may crash due to buffer overflow? My situation is a perl program in a loop trying 500 times in 10 seconds opening a telnet connection and closing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
10 秒内 Telnet 500 次不应使您的客户端程序崩溃,但我怀疑服务器上的 telnet 和登录进程能否跟上这种连接速率。 您需要找到一种方法来保持 telnet 连接打开或切换到为轮询设计的协议,例如 SNMP。
尽管如此,您没有指出您正在使用什么 Telnet 库或程序,因此肯定存在它存在错误的可能性。
简而言之,我认为您的用例并不真正符合 Telnet 规范。
Telnetting 500 times in 10 seconds shouldn't crash your client program, but I doubt your telnet and login processes on the server can keep up with that kind of a connection rate. You need to figure out a way to leave the telnet connection open or switch to a protocol designed for polling, such as SNMP.
All that said, you didn't indicate what Telnet library or program you're using, so the possibility is certainly out there that it is buggy.
In short, I don't think your use case is really in spec for Telnet.
我们需要查看 Perl 程序(我假设您有它,否则您怎么知道它是 Perl)。
一种可能性是 Perl 脚本无法识别 telnet 守护程序提供的登录字符串,因此关闭连接并重试。
我不确定为什么您会认为这是缓冲区溢出(除非您有我们没有的信息)。 在我看来,如果 Perl(解释器,而不是脚本)有缓冲区溢出,它就会崩溃并且不会重试(假设没有其他东西重试脚本)。
如果您认为您的脚本存在缓冲区溢出问题,我们再次需要查看它来帮助您解决问题。
We'd need to see the Perl program (and I'm assuming you have it otherwise how would you know it's Perl).
One possibility is that the Perl script is not recognizing the login strings presented by your telnet daemon and so is shutting down the connection and retrying.
I'm not sure why you'd think it was a buffer overflow (unless you have information that we don't). It seems to me that if Perl (the interpreter, not the script) had a buffer overflow, it would just crash and there would be no retries (assuming there's not something else retrying the script).
If you think your script has a buffer overflow problem, again we'd need to see it to help you out.
为什么不能让 telnet 连接保持打开状态?
我将只打开一个 telnet 连接并将其保持打开状态并使用它来发送和接收数据。 如果在指定的超时时间内没有响应,则关闭它并再次打开它。
Why can't you just leave the telnet connection open?
I would open just a single telnet connection and leave it open and use it to send and receive data. If there is no response in a specified timeout than close it and open it again.