dsizmmwnm56437180 2016-06-29 06:55
浏览 239
已采纳

ReadMsgUDP中的返回参数“ flags”是什么意思?

I'm using the function ReadMsgUDP in connectionless-oriented UDP, and it goes well so far. But I have no idea about the return parameter flags, anyone knows it?

Moreover, I'm Chinese and cannot visit the official Go website in Google, can anyone send me some official documents of Go via mail?

  • 写回答

1条回答 默认 最新

  • dongtao9158 2016-06-29 07:06
    关注

    You don't need to have access to Go's website to read the documentation. The distributions include a tool called godoc which can start a local HTTP server and host a similar website you see on Go's home page. You can start it locally by running the following command:

    godoc -http=:6060
    

    Then visit the following local URL in your browser:

    http://localhost:6060/
    

    Documentation of UDPConn.ReadMsgUDP():

    http://localhost:6060/pkg/net/#UDPConn.ReadMsgUDP
    

    Quoting the relevant part:

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 模型在y分布之外的数据上预测能力不好如何解决
  • ¥15 processing提取音乐节奏
  • ¥15 gg加速器加速游戏时,提示不是x86架构
  • ¥15 python按要求编写程序
  • ¥15 Python输入字符串转化为列表排序具体见图,严格按照输入
  • ¥20 XP系统在重新启动后进不去桌面,一直黑屏。
  • ¥15 opencv图像处理,需要四个处理结果图
  • ¥15 无线移动边缘计算系统中的系统模型
  • ¥15 深度学习中的画图问题
  • ¥15 java报错:使用mybatis plus查询一个只返回一条数据的sql,却报错返回了1000多条