public void EndWrite(IAsyncResult iar) { myAsyncResult mar = iar as myAsyncResult; mar.Wait(); if (mar.IsFaulted) { throw (mar.Exception); } }