Esempio n. 1
0
        public override int EndRead(IAsyncResult asyncResult)
        {
            _event.WaitOne();
            AsyncRes res = (AsyncRes)asyncResult;

            return(Read(res.Buffer, res.Offset, res.Count));
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 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;
 }