func (c *payloadHandler) ReadBatch(ms []Message, flags int) (int, error) {
	if !c.ok() {
		return 0, errInvalidConn
	}
	switch runtime.GOOS {
	case "linux":
		n, err := c.RecvMsgs([]socket.Message(ms), flags)
		if err != nil {
			err = &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err}
		}
		return n, err
	default:
		n := 1
		err := c.RecvMsg(&ms[0], flags)
		if err != nil {
			n = 0
			err = &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err}
		}
		if compatFreeBSD32 && ms[0].NN > 0 {
			adjustFreeBSD32(&ms[0])
		}
		return n, err
	}
}
ReadBatch reads a batch of messages.

The provided flags is a set of platform-dependent flags, such as
syscall.MSG_PEEK.

On a successful read it returns the number of messages received, up
to len(ms).

On Linux, a batch read will be optimized.
On other platforms, this method will read only a single message.

Unlike the ReadFrom method, it doesn't strip the IPv4 header
followed by option headers from the received IPv4 datagram when the
underlying transport is net.IPConn. Each Buffers field of Message
must be large enough to accommodate an IPv4 header and option
headers.
package ipv4
import (
	"net"
	"runtime"
	"golang.org/x/net/internal/socket"
)
type Message = socket.Message