public override int EndRead(IAsyncResult asyncResult) { _event.WaitOne(); AsyncRes res = (AsyncRes)asyncResult; return(Read(res.Buffer, res.Offset, res.Count)); }
public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state) { _event.Reset(); AsyncRes res = new AsyncRes(buffer, offset, count); callback.BeginInvoke(res, null, state); return(res); }
public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state) { _event.Reset(); AsyncRes res = new AsyncRes(buffer, offset, count); callback.BeginInvoke(res, null, state); return res; }