internal void ConvertPingLocationToString(ref NetPingLocation location, out string pszBuf)
        {
            IntPtr mempszBuf = Helpers.TakeMemory();

            _ConvertPingLocationToString(Self, ref location, mempszBuf, (1024 * 32));
            pszBuf = Helpers.MemoryToString(mempszBuf);
        }
 private static extern void _ConvertPingLocationToString(IntPtr self, ref NetPingLocation location, IntPtr pszBuf, int cchBufSize);
 private static extern int _EstimatePingTimeFromLocalHost(IntPtr self, ref NetPingLocation remoteLocation);
        internal int EstimatePingTimeFromLocalHost(ref NetPingLocation remoteLocation)
        {
            var returnValue = _EstimatePingTimeFromLocalHost(Self, ref remoteLocation);

            return(returnValue);
        }
 private static extern int _EstimatePingTimeBetweenTwoLocations(IntPtr self, ref NetPingLocation location1, ref NetPingLocation location2);
        internal int EstimatePingTimeBetweenTwoLocations(ref NetPingLocation location1, ref NetPingLocation location2)
        {
            var returnValue = _EstimatePingTimeBetweenTwoLocations(Self, ref location1, ref location2);

            return(returnValue);
        }
        internal float GetLocalPingLocation(ref NetPingLocation result)
        {
            var returnValue = _GetLocalPingLocation(Self, ref result);

            return(returnValue);
        }
 private static extern float _GetLocalPingLocation(IntPtr self, ref NetPingLocation result);
        internal bool ParsePingLocationString([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8StringToNative))] string pszString, ref NetPingLocation result)
        {
            var returnValue = _ParsePingLocationString(Self, pszString, ref result);

            return(returnValue);
        }
 private static extern bool _ParsePingLocationString(IntPtr self, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(Utf8StringToNative))] string pszString, ref NetPingLocation result);
Exemplo n.º 11
0
 /// <summary>
 /// Same as PingLocation.EstimatePingTo, but assumes that one location is the local host.
 /// This is a bit faster, especially if you need to calculate a bunch of
 /// these in a loop to find the fastest one.
 /// </summary>
 public static int EstimatePingTo(NetPingLocation target)
 {
     return(Internal.EstimatePingTimeFromLocalHost(ref target));
 }