- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
This link TCP中有关于OOB的信息。
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.
但是 UDP 呢?
在golang中,ReadMsgUDP
函数需要一个oob
byte slice 。
func (c *UDPConn) ReadMsgUDP(b, oob []byte) (n, oobn, flags int, addr *UDPAddr, err error)
oob
有什么用?开源代码中是否有任何用例?或者我应该使用 PacketConn
而不是 UDPConn
?
最佳答案
好吧,正如我所尝试的,当您希望其他信息(例如 pktinfo)通过设置 syscall.setsockoption 获取本地地址时,您将需要它。当您不想要面向连接的 UDP 时,就会发生这种情况。
关于go - func (*UDPConn) ReadMsgUDP 中的 oob 是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37268653/
1.我们能否在同一个 net.UDPConn 或 net.TCPConn 对象上从一个线程调用发送并从另一个线程调用接收? 2.我们能否从同一 net.UDPConn 或 net.TCPConn 对象
如果 UDP 是无连接协议(protocol),那么为什么 UDPConn 有一个 Close 方法?文档说“关闭关闭连接”,但 UDP 是无连接的。在 UDPConn 对象上调用 Close 是一种
作为测试,我编写了一些小工具来测试两台 PC 之间的 LAN 连接。这是一种客户端/服务器模型,它只发送尽可能多的 UDP 数据包,而在另一端我会尽我所能阅读。 为了最大限度地利用我的资源,我为我的机
我正在尝试实现以下 UDP 协议(protocol),但我在弄清楚我应该如何处理这个问题时遇到了一些麻烦。 协议(protocol)声明我应该将特定的 UDP 数据包发送到某个服务器,之后服务器将流(
This link TCP中有关于OOB的信息。 With out-of-band data we want the byte-stream service layer on the sending
我需要在多播 UDP 连接/套接字上设置 IP_MULTICAST_LOOP,以便我可以在本地机器上发送/接收多播数据包。这是我发现应该有效的调用: l, err := net.ListenMulti
如何在 Windows 上获取 *net.UDPConn 的底层 syscall.Handle?我希望此句柄通过 syscall.SetsockoptInt 设置 IP_MULTICAST_TTL。在
我是一名优秀的程序员,十分优秀!