Perl 创建 SSL 套接字失败并显示“错误主机名” 1020 个插座后
需要一些帮助。我完全陷入困境,整整一周都在努力解决这个问题。我有一个充当电子邮件服务器的 perl 脚本。在设置 1,020 个 SSL 套接字后,每次之前的每个套接字都工作正常时,它就会开始失败。有什么建议吗?为什么说主机名错误?
我得到的错误是
设置用户 1014...完成!
设置用户 1015...完成!
设置用户 1016...完成!
设置用户 1017...完成!
设置用户 1018...完成!
设置用户 1019...完成!
设置用户 1020...错误:new_imap:socket():IO::Socket::SSL:错误的主机名“imap.gmail.com”
尝试2:错误:new_imap:socket():IO :: Socket :: SSL:错误的主机名'imap.gmail.com'
如果我在IO :: Socket :: SSL中打开DEBUG,它会吐出一堆与此一起的数字,
SSL.pm:1201: IO::Socket::INET 配置失败错误:00000000:lib(0):func(0):reason(0)
Could use some help. I am utterly stuck, been trying to fix this one for a whole week. I have a perl script that acts as an email server. After it sets up 1,020 SSL Sockets, it starts failing every time when for every socket before that works fine. Any suggestions? Why is it saying bad hostname?
The error I get is
Setting up user 1014...DONE!
Setting up user 1015...DONE!
Setting up user 1016...DONE!
Setting up user 1017...DONE!
Setting up user 1018...DONE!
Setting up user 1019...DONE!
Setting up user 1020...ERROR: new_imap: socket(): IO::Socket::SSL: Bad hostname 'imap.gmail.com'
Try 2: ERROR: new_imap: socket(): IO::Socket::SSL: Bad hostname 'imap.gmail.com'
If I turn on DEBUG in IO::Socket::SSL, it spits out a bunch of numbers along with this,
SSL.pm:1201: IO::Socket::INET configuration failederror:00000000:lib(0):func(0):reason(0)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来您可能用完了文件描述符。您是否同时保持所有这些套接字打开?或者,如果您要关闭它们,也许您的 SO_LINGER 设置
让他们停留的时间比你想要的要长吗?
根据您的平台,您也许可以对其进行配置以增加数量
每个进程可用的文件描述符的数量。
It sounds like you might be running out of file descriptors. Are you keeping all these sockets open at the same time? Or if you're closing them, maybe your SO_LINGER setting
is making them stick around longer than you'd like?
Depending on your platform, you may be able to configure it to increase the number
of file descriptors available to each process.