Exemplo n.º 1
0
        private void OnResolve(IntPtr resolver, int status, IntPtr addrinfo)
        {
            var callback = _resolveCallback;

            _resolveCallback = null;

            try
            {
                IPEndPoint[] value = null;
                if (status == 0)
                {
                    var info = ((addrinfo)Marshal.PtrToStructure(addrinfo, typeof(addrinfo)));
                    value = info.EndPoints.ToArray();
                }

                callback.Invoke(status, value, this.OnResolve, this.Resolved);
            }
            finally
            {
                Uvi.uv_freeaddrinfo(addrinfo);
                this.Loop.Requests.Delete(_resolveReq);
            }
        }