quic: add the ability to create an endpoint with a fake network

Add a NewEndpoint function to create an *Endpoint using a net.PacketConn.
We rely on a number of features of *net.UDPConn which aren't provided
by PacketConn, so an Endpoint using anything other than a UDPConn will
be limited. The main use case for providing a non-UDPConn connection
is testing, in particular tests which use testing/synctest and cannot
use a concrete network connection.

Change-Id: I9e62cb8d7d545f64d99103beb9a32f149d4119bf
Reviewed-on: https://go-review.googlesource.com/c/net/+/641498
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
2 files changed
tree: 390a8d6f2babfc3405ddad8af3b4d6765e9f2a47
  1. bpf/
  2. context/
  3. dict/
  4. dns/
  5. html/
  6. http/
  7. http2/
  8. icmp/
  9. idna/
  10. internal/
  11. ipv4/
  12. ipv6/
  13. lif/
  14. nettest/
  15. netutil/
  16. proxy/
  17. publicsuffix/
  18. quic/
  19. route/
  20. trace/
  21. webdav/
  22. websocket/
  23. xsrftoken/
  24. .gitattributes
  25. .gitignore
  26. codereview.cfg
  27. CONTRIBUTING.md
  28. go.mod
  29. go.sum
  30. LICENSE
  31. PATENTS
  32. README.md
README.md

Go Networking

Go Reference

This repository holds supplementary Go networking packages.

Report Issues / Send Patches

This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://go.dev/doc/contribute.

The git repository is https://go.googlesource.com/net.

The main issue tracker for the net repository is located at https://go.dev/issues. Prefix your issue with “x/net:” in the subject line, so it is easy to find.