Skip to content

Commit

Permalink
quic: add LocalAddr and RemoteAddr to quic.Conn
Browse files Browse the repository at this point in the history
These are missing for quic.Conn.

Fixes golang/go#70138

Change-Id: Ia443ffe0e73e143be5c29233a1ceb7cb16951acd
GitHub-Last-Rev: a326378
GitHub-Pull-Request: #225
Reviewed-on: https://go-review.googlesource.com/c/net/+/623157
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
  • Loading branch information
jfgiorgi authored and gopherbot committed Nov 6, 2024
1 parent 858db1a commit d7f220d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions quic/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,16 @@ func (c *Conn) String() string {
return fmt.Sprintf("quic.Conn(%v,->%v)", c.side, c.peerAddr)
}

// LocalAddr returns the local network address, if known.
func (c *Conn) LocalAddr() netip.AddrPort {
return c.localAddr
}

// RemoteAddr returns the remote network address, if known.
func (c *Conn) RemoteAddr() netip.AddrPort {
return c.peerAddr
}

// confirmHandshake is called when the handshake is confirmed.
// https://www.rfc-editor.org/rfc/rfc9001#section-4.1.2
func (c *Conn) confirmHandshake(now time.Time) {
Expand Down

0 comments on commit d7f220d

Please sign in to comment.