예제 #1
0
        /// <summary>
        /// Extended write function for sending handles over a pipe. The pipe must be initialized with an IPC option.
        /// </summary>
        /// <param name="handleToSend"></param>
        /// <param name="callback"></param>
        /// <param name="state"></param>
        public void WriteHandle(UvStream handleToSend, UvWriteRequest.CallbackDelegate callback, object state = null)
        {
            this.EnsureCallingThread();

            var request = new UvWriteHandleRequest(this, handleToSend, callback, state);

            request.Write();
        }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the hadnle write request.
 /// </summary>
 /// <param name="baseHandle"></param>
 /// <param name="handleToSend"></param>
 /// <param name="callback"></param>
 /// <param name="state"></param>
 public UvWriteHandleRequest(UvPipe baseHandle, UvStream handleToSend, CallbackDelegate callback, object state)
     : base(baseHandle, _DummyMessage, callback, state)
 {
     if (!baseHandle.Ipc)
     {
         throw new ArgumentException("Sending handles is allowed only for pipe handles with enabled IPC.", nameof(handleToSend));
     }
     this.HandleToSend = handleToSend;
 }
예제 #3
0
 /// <summary>
 /// This call is used in conjunction with <see cref="Listen"/> to accept incoming connections.
 /// Call this function after receiving a <see cref="ListenCallbackDelegate"/> to accept the connection.
 /// </summary>
 /// <param name="client"></param>
 public void Accept(UvStream client)
 {
     this.EnsureCallingThread();
     Libuv.EnsureSuccess(Libuv.uv_accept(this, client));
 }
예제 #4
0
 internal override void Write(UvBuffer[] buffers)
 {
     Libuv.EnsureSuccess(Libuv.uv_write2(this, this.BaseHandle, buffers, buffers.Length, this.HandleToSend, _UvWriteCallback));
     this.Buffers      = null;
     this.HandleToSend = null;
 }