quic: basic connection event loop

Add the Conn type, representing a QUIC connection.

A Conn's behavior is driven by an event loop goroutine.
This goroutine owns most Conn state. External events
(datagrams received, user operations such as writing to streams)
send events to the loop goroutine on a message channel.

The testConn type, used in tests, wraps a Conn and takes
control of its event loop. The testConn permits tests to
interact with a Conn synchronously, sending it events,
observing the result, and controlling the Conn's view
of time passing.

Add a very minimal implementation of connection idle timeouts
(RFC 9000, Section 10.1) to test the implementation of
synthetic time.

For golang/go#58547

Change-Id: Ic517e5e7bb019f4a677f892a807ca0417d6e19b1
Reviewed-on: https://go-review.googlesource.com/c/net/+/506678
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Damien Neil <dneil@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
3 files changed
tree: dcb5cc567614e973f0167752b02a2765b3315462
  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. route/
  19. trace/
  20. webdav/
  21. websocket/
  22. xsrftoken/
  23. .gitattributes
  24. .gitignore
  25. codereview.cfg
  26. CONTRIBUTING.md
  27. go.mod
  28. go.sum
  29. LICENSE
  30. PATENTS
  31. README.md
README.md

Go Networking

Go Reference

This repository holds supplementary Go networking libraries.

Download/Install

The easiest way to install is to run go get -u golang.org/x/net. You can also manually git clone the repository to $GOPATH/src/golang.org/x/net.

Report Issues / Send Patches

This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html. The main issue tracker for the net repository is located at https://github.com/golang/go/issues. Prefix your issue with “x/net:” in the subject line, so it is easy to find.