public Dictionary <DCP.BlockOptions, object> EndGetRequest(IAsyncResult result, int timeoutMs)
        {
            ProfinetAsyncDcpResult r = (ProfinetAsyncDcpResult)result;

            if (result.AsyncWaitHandle.WaitOne(timeoutMs))
            {
                Dictionary <DCP.BlockOptions, object> ret = r.Result;
                r.Dispose();
                return(ret);
            }
            else
            {
                r.Dispose();
                throw new TimeoutException("No response received");
            }
        }
        public DCP.BlockErrors EndSetRequest(IAsyncResult result, int timeoutMs)
        {
            ProfinetAsyncDcpResult r = (ProfinetAsyncDcpResult)result;

            if (result.AsyncWaitHandle.WaitOne(timeoutMs))
            {
                DCP.BlockErrors ret = r.Result.ContainsKey(DCP.BlockOptions.Control_Response) ? ((DCP.ResponseStatus)r.Result[DCP.BlockOptions.Control_Response]).Error : DCP.BlockErrors.NoError;
                r.Dispose();
                return(ret);
            }
            else
            {
                r.Dispose();
                throw new TimeoutException("No response received");
            }
        }