// Copyright 2016 The Go Authors. All rights reserved.// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.// Package netreflect implements run-time reflection for the// facilities of net package.packagenetreflectimport("errors""net")var(errInvalidType=errors.New("invalid type")errOpNoSupport=errors.New("operation not supported"))// SocketOf returns the socket descriptor of c.funcSocketOf(cnet.Conn)(uintptr,error){switchc.(type){case*net.TCPConn,*net.UDPConn,*net.IPConn,*net.UnixConn:returnsocketOf(c)default:return0,errInvalidType}}// PacketSocketOf returns the socket descriptor of c.funcPacketSocketOf(cnet.PacketConn)(uintptr,error){switchc.(type){case*net.UDPConn,*net.IPConn,*net.UnixConn:returnsocketOf(c.(net.Conn))default:return0,errInvalidType}}