Exemplo n.º 1
0
        public override void EndWrite(IAsyncResult result)
        {
            if (result == null)
            {
                throw new ArgumentNullException("result");
            }

            if (!IsAsync)
            {
                base.EndWrite(result);
            }

            if (!(result is VfsStreamAsyncResult))
            {
                throw new ArgumentException("Invalid IAsyncResult object", "result");
            }

            VfsStreamAsyncResult asyncResult = (VfsStreamAsyncResult)result;

            if (asyncResult.Done)
            {
                throw new InvalidOperationException("EndWrite already called");
            }
            asyncResult.Done = true;

            while (!asyncResult.IsCompleted)
            {
                MainContext.Iteration();
            }

            if (asyncResult.Exception != null)
            {
                throw asyncResult.Exception;
            }
        }
Exemplo n.º 2
0
		public VfsStreamAsyncResult BeginWrite ()
		{
			asyncResult = new VfsStreamAsyncResult (state);
			Async.Write (handle, out buffer[offset], (uint)count, new AsyncWriteCallback (AsyncWrite));
			return asyncResult;
		}
Exemplo n.º 3
0
 public VfsStreamAsyncResult BeginWrite()
 {
     asyncResult = new VfsStreamAsyncResult(state);
     Async.Write(handle, out buffer[offset], (uint)count, new AsyncWriteCallback(AsyncWrite));
     return(asyncResult);
 }
Exemplo n.º 4
0
		public VfsStreamAsyncResult BeginRead ()
		{
			asyncResult = new VfsStreamAsyncResult (state);
			Async.Read (handle, out buffer[offset], (uint)count, new AsyncReadCallback (AsyncRead));
			return asyncResult;
		}