Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
github.com/anacrolix/mmsg exposes the batching methods from golang.org/x/net/internal/socket, falling back on OSs that don't implement them. golang.org/x/net does expose the batching APIs but you have to be explicit about whether you're using ipv4 or ipv6, and IDGAF, it shouldn't be exposed like that. Message.AddrPort reports the sender as a netip.AddrPort, which costs nothing to produce, so a receive allocates nothing at all, batched or not. Message.Addr is a method rather than a field: it builds a net.Addr from AddrPort the first time it's called, and only callers that want one pay for it. ./socket is taken from golang.org/x/net/internal/socket because we need access to the package and it's internal to golang.org/x/net/internal/socket. ./internal/nettest is taken from golang.org/x/net/nettest. I think because ./socket expects it and we don't want to unnecessarily introduce extra dependencies to golang.org/x/net. The LICENSE file is taken from golang.org/x/net and put into the respective directories sourced from that module.