我正在面向无连接的 UDP 中使用函数 ReadMsgUDP
,到目前为止一切顺利。但我不知道返回参数flags
,有人知道吗?
另外,我是中国人,无法访问Google的Go官方网站,有谁可以通过邮件给我发一些Go的官方文档吗?
最佳答案
您无需访问 Go 的网站即可阅读文档。这些发行版包括一个名为 godoc
的工具。它可以启动本地 HTTP 服务器并托管您在 Go 主页上看到的类似网站。您可以通过运行以下命令在本地启动它:
godoc -http=:6060
然后在浏览器中访问以下本地 URL:
http://localhost:6060/
UDPConn.ReadMsgUDP()
的文档:
http://localhost:6060/pkg/net/#UDPConn.ReadMsgUDP
引用相关部分:
func (c *UDPConn) ReadMsgUDP(b, oob []byte) (n, oobn, flags int, addr *UDPAddr, err error)
ReadMsgUDP reads a packet from c, copying the payload into b and the associated out-of-band data into oob. It returns the number of bytes copied into b, the number of bytes copied into oob, the flags that were set on the packet and the source address of the packet.
关于go - ReadMsgUDP中返回参数 "flags"是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38092388/