what is the difference between gen_tcp:recv and prim_inet recv

被刻印的时光 ゝ 提交于 2021-02-10 18:22:55

问题


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 ?


回答1:


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.



来源:https://stackoverflow.com/questions/13187682/what-is-the-difference-between-gen-tcprecv-and-prim-inet-recv

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!