ruby使用UDPSocket的recvfrom方法,通信变得很慢

When doing data, addr = @socket.recvfrom(1500), the addr array contains Array: ["AF_INET", port, "resolved-name-or-ip", "ip"]

创新互联专注于中大型企业的网站建设、成都网站设计和网站改版、网站营销服务,追求商业策划与数据分析、创意艺术与技术开发的融合,累计客户上1000+,服务满意度达97%。帮助广大客户顺利对接上互联网浪潮,准确优选出符合自己需要的互联网运用,我们将一直专注高端网站设计和互联网程序开发,在前进的路上,与客户一起成长!

How can I disable resolving on UDPSocket? The documentation for ruby UDPSocket is bit poor.

Ok. I found it.

I'll document this here so someone might get lucky and find it.

To disable automatic lookups, put this in your code:

BasicSocket.do_not_reverse_lookup = true

before you create the socket. It does the trick.

当前文章:ruby使用UDPSocket的recvfrom方法,通信变得很慢
网站路径:https://www.cdcxhl.com/article16/picegg.html

成都网站建设公司_创新互联,为您提供网站制作域名注册商城网站虚拟主机企业网站制作做网站

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

网站托管运营