From 36ef35ddb673678fe5e629161b605c12fcb3277f Mon Sep 17 00:00:00 2001 From: Menghan Li Date: Thu, 1 Nov 2018 14:31:51 -0700 Subject: [PATCH] internal: add doc to tlsConn wrapper for channelz (#2421) --- credentials/credentials.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/credentials/credentials.go b/credentials/credentials.go index 6c2b811fd50a..ae1bc3027e07 100644 --- a/credentials/credentials.go +++ b/credentials/credentials.go @@ -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