Esempio n. 1
0
        /// <summary>
        /// Extends BeginRead so that when a state object is not needed, null does not need to be passed.
        /// <example>
        /// pipestream.BeginRead(buffer, offset, count, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginRead(this AnonymousPipeClientStream pipestream, Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback)
        {
            if (pipestream == null)
            {
                throw new ArgumentNullException("pipestream");
            }

            return(pipestream.BeginRead(buffer, offset, count, callback, null));
        }
Esempio n. 2
0
        /// <summary>
        /// Extends BeginRead so that buffer offset of 0 and call to Array.Length are not needed.
        /// <example>
        /// pipestream.BeginRead(buffer, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginRead(this AnonymousPipeClientStream pipestream, Byte[] buffer, AsyncCallback callback)
        {
            if (pipestream == null)
            {
                throw new ArgumentNullException("pipestream");
            }

            if (buffer == null)
            {
                throw new ArgumentNullException("buffer");
            }

            return(pipestream.BeginRead(buffer, 0, buffer.Length, callback));
        }
Esempio n. 3
0
 public AnonPipeClientRead(string pipeHandle)
 {
     pRead    = new AnonymousPipeClientStream(PipeDirection.In, pipeHandle);
     pipeBuff = new byte[10240];
     pRead.BeginRead(pipeBuff, 0, 4, PipeReadCallback, null);
 }