// 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.// +build darwin dragonfly freebsd linux netbsd openbsd solaris windowspackagenetreflectimport("net""reflect""runtime")funcsocketOf(cnet.Conn)(uintptr,error){v:=reflect.ValueOf(c)switche:=v.Elem();e.Kind(){casereflect.Struct:fd:=e.FieldByName("conn").FieldByName("fd")switche:=fd.Elem();e.Kind(){casereflect.Struct:sysfd:=e.FieldByName("sysfd")ifruntime.GOOS=="windows"{returnuintptr(sysfd.Uint()),nil}returnuintptr(sysfd.Int()),nil}}return0,errInvalidType}