gen_tcp:recv和prim_inet recv有什么区别 [英] what is the difference between gen_tcp:recv and prim_inet recv

查看:111
本文介绍了gen_tcp:recv和prim_inet recv有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是prim_inet模块,它如何工作?
我试图用Google搜索它,但没有找到任何有用的文档.
我查看了源文件prim_inet.erl,但是没有什么特别的地方,dose prim_inet:async_recv为每个recv生成了一个新进程?

解决方案

您没有找到任何有用的文档,因为没有记录内部的不是要从应用程序直接调用的 erlang 模块./p>

请参见为什么prim_inet未记录.在该链接中,您将阅读以下内容:

未记录,因为它是未提及的内部模块从应用程序中调用.其界面可能会更改,而无需即使在最小的补丁中也发出警告.

如果gen_tcp中没有提供您需要的功能,gen_udp,gen_sctp,inet等...您只是询问一下,可能有可以是另一种方式,也可以将其添加到公众中界面应该在哪里.

但是,您可能会找到 prim_inet:async_accept/2 有用.

What is prim_inet module , how it works ?
i tried to google it but i didn't find any useful docs.
i looked at the source file prim_inet.erl but nothing special there , dose prim_inet:async_recv spawn a new process for each recv ?

解决方案

You found no useful documentation because erlang modules that are internal and not meant to be directly called from applications aren't documented.

Please see "Why prim_inet undocumented. In that link you will read the following:

It is undocumented because it is an internal module that is not ment to be called from applications. Its interface may change without warning in even the smallest patch.

If there is functionality you need that is not provided in gen_tcp, gen_udp, gen_sctp, inet etc... you just ask about it and there may either be another way to do it, or it may be added to the public interface where it should be.

However, you might find prim_inet:async_accept/2 useful.

这篇关于gen_tcp:recv和prim_inet recv有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆