Skip to content

Commit

Permalink
internal: add doc to tlsConn wrapper for channelz (#2421)
Browse files Browse the repository at this point in the history
  • Loading branch information
menghanl authored Nov 1, 2018
1 parent 0efb1e1 commit 36ef35d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions credentials/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,15 @@ type OtherChannelzSecurityValue struct {

func (*OtherChannelzSecurityValue) isChannelzSecurityValue() {}

// tlsConn keeps reference of rawConn to support syscall.Conn for channelz.
// SyscallConn() (the method in interface syscall.Conn) is explicitly
// implemented on this type,
//
// Interface syscall.Conn is implemented by most net.Conn implementations (e.g.
// TCPConn, UnixConn), but is not part of net.Conn interface. So wrapper conns
// that embed net.Conn don't implement syscall.Conn. (Side note: tls.Conn
// doesn't embed net.Conn, so even if syscall.Conn is part of net.Conn, it won't
// help here).
type tlsConn struct {
*tls.Conn
rawConn net.Conn
Expand Down

0 comments on commit 36ef35d

Please sign in to comment.