return参数"flags"在ReadMsgUDP中是什么意思?
What does the return parameter "flags" mean in ReadMsgUDP?
我在面向无连接的 UDP 中使用函数 ReadMsgUDP
,到目前为止一切顺利。但是我不知道return这个参数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.
我在面向无连接的 UDP 中使用函数 ReadMsgUDP
,到目前为止一切顺利。但是我不知道return这个参数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.