duanqiangwu9332 2016-05-17 06:26
浏览 238
已采纳

func(* UDPConn)ReadMsgUDP中的oob是什么?

This link has information about OOB in TCP.

With out-of-band data we want the byte-stream service layer on the sending side to send this data before any other data that it has buffered. Similarly we want the receiving end to pass this data to its user process ahead of any data that it might have buffered.

But what about UDP?

In golang, the ReadMsgUDP function requires an oob byte slice.

func (c *UDPConn) ReadMsgUDP(b, oob []byte) (n, oobn, flags int, addr *UDPAddr, err error)

What is the oob for? Are there any use cases in open source code? Or should I use PacketConn instead of UDPConn?

  • 写回答

1条回答 默认 最新

  • dqtm8504 2016-06-29 06:29
    关注

    Well, as I tried, when you want other infomation(such as pktinfo) to get local address with setting syscall.setsockoption, you will need it. This happens when you don't want connection-oriented UDP.

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

报告相同问题?

悬赏问题

  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法