erlang inet_db:gethostname() 机制请教cherbim3年前发布960# /etc/hosts127.0.0.1 localhost myhostname::1 localhost这种情况下,inet:gethostname(). = myhostnameinet_db:gethostname(). = localhost但是我看了 inet_db:set_hostname 源码,db 的 hostname 也是通过 inet_config 模块调用 inet:get_hostname 实现的,后面我手动调用得到的值也是 myhostname ,并非 localhost—————-然后只要我把 /etc/hosts 文件改成127.0.0.1 localhost::1 localhost结果就是对的了:inet:gethostname(). = myhostnameinet_db:gethostname(). = myhostname实在是困惑,请各位大佬解惑。十分感谢!
没有回复内容