Exemplo n.º 1
0
        public override int EndRead(IAsyncResult asyncResult)
        {
            if (asyncResult == null)
            {
                throw new ArgumentNullException("asyncResult");
            }

            AsyncResult ar = asyncResult as AsyncResult;

            if (ar == null)
            {
                throw new ArgumentException("Invalid asyncResult", "asyncResult");
            }

            ReadDelegate del = ar.AsyncDelegate as ReadDelegate;

            if (del == null)
            {
                throw new ArgumentException("Invalid asyncResult", "asyncResult");
            }

#if SSHARP
            return(del.EndInvokeEx <int> (asyncResult));
#else
            return(del.EndInvoke(asyncResult));
#endif
        }