Skip to content

Commit d7f220d

Browse files
jfgiorgigopherbot
authored andcommitted
quic: add LocalAddr and RemoteAddr to quic.Conn
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 <[email protected]> Reviewed-by: David Chase <[email protected]> Auto-Submit: Damien Neil <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 858db1a commit d7f220d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

quic/conn.go

+10
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,16 @@ func (c *Conn) String() string {
176176
return fmt.Sprintf("quic.Conn(%v,->%v)", c.side, c.peerAddr)
177177
}
178178

179+
// LocalAddr returns the local network address, if known.
180+
func (c *Conn) LocalAddr() netip.AddrPort {
181+
return c.localAddr
182+
}
183+
184+
// RemoteAddr returns the remote network address, if known.
185+
func (c *Conn) RemoteAddr() netip.AddrPort {
186+
return c.peerAddr
187+
}
188+
179189
// confirmHandshake is called when the handshake is confirmed.
180190
// https://www.rfc-editor.org/rfc/rfc9001#section-4.1.2
181191
func (c *Conn) confirmHandshake(now time.Time) {

0 commit comments

Comments
 (0)