private void HostIPResolved(IAsyncResult result) { try { AsyncStateForIP state = (AsyncStateForIP)result.AsyncState; IPHostEntry entry = state._resolveMethod.EndInvoke(result); if(entry != null) state._storeResultMethod(entry.AddressList); } catch { } }
public void ResolveHostIP(string name, StoreHostIPDelegate callback) { AsyncStateForIP state = new AsyncStateForIP(new GetHostEntryDelegate(GetHostEntry), callback); state._resolveMethod.BeginInvoke(name, new AsyncCallback(HostIPResolved), state); }