func connFd(conn *net.UDPConn) (int, error) {
	sc, err := conn.SyscallConn()
	if err != nil {
		return -1, err
	}
	var intfd int
	err = sc.Control(func(fd uintptr) {
		intfd = int(fd)
	})
	if err != nil {
		return -1, err
	}
	return intfd, nil
}
connFd returns file descriptor of a connection
package ntp
import (
	"net"
	"time"
)
const NanosecondsToUnix = int64(2208988800000000000)
func Time(t time.Time) (seconds uint32, fracions uint32) {
	nsec := t.UnixNano() + NanosecondsToUnix
	sec := nsec / time.Second.Nanoseconds()
	return uint32(sec), uint32((nsec - sec*time.Second.Nanoseconds()) << 32 / time.Second.Nanoseconds())
}
func Unix(seconds, fractions uint32) time.Time {
	secs := int64(seconds) - NanosecondsToUnix/time.Second.Nanoseconds()
	nanos := (int64(fractions) * time.Second.Nanoseconds()) >> 32  
	return time.Unix(secs, nanos)
}
func abs(x int64) int64 {
	if x < 0 {
		return -x
	}
	return x
}
func AvgNetworkDelay(clientTransmitTime, serverReceiveTime, serverTransmitTime, clientReceiveTime time.Time) int64 {
	forwardPath := serverReceiveTime.Sub(clientTransmitTime).Nanoseconds()
	returnPath := clientReceiveTime.Sub(serverTransmitTime).Nanoseconds()
	return abs(forwardPath+returnPath) / 2
}
func CurrentRealTime(serverTransmitTime time.Time, avgNetworkDelay int64) time.Time {
	return serverTransmitTime.Add(time.Duration(avgNetworkDelay) * time.Nanosecond)
}
func CalculateOffset(currentRealTime, curentLocaTime time.Time) int64 {
	return currentRealTime.UnixNano() - curentLocaTime.UnixNano()
}