go - ReadMsgUDP中返回参数 "flags"是什么意思?

标签 go udp

我正在面向无连接的 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/

相关文章:

Nginx:WebSocket 通配符位置

api - 如何从 "test"包测试 Golang 中的主包?

golang - 编码 PKCS8 私钥?

http - 如何将 http.HandleFunc 与 slugs 一起使用

Java:接收具有多个DatagramSockets的UDP datgram数据包

multithreading - 使用 Netty 在 UDP 服务器中丢失了大量 UDP 请求

http - 使用计算键去构造

c# - .NET 应用程序需要微秒级延迟来限制 UDP 多播传输速率

c# - 当服务器和客户端在同一台机器上时收听广播

networking - NIC 和用户应用程序之间的 *nix 系统中的内存副本计数?