Пример #1
0
        //public event Action<string, string> OnExit;
        //private void HandleExit(string stdout, string stderr);

        public ChildProcess(string command)
        {
            this.File = command;
            this.CurrentWorkingDirectory = Directory.GetCurrentDirectory();
            this._stdout = Marshal.AllocHGlobal(Sizes.PipeT);
            uv_pipe_init(_stdout);
            this.StdOut  = new UVStream(_stdout);
            this._stderr = Marshal.AllocHGlobal(Sizes.PipeT);
            uv_pipe_init(_stdout);
            this.StdOut  = new UVStream(_stdout);
            this._handle = Marshal.AllocHGlobal(Sizes.ProcessT);
        }
Пример #2
0
        public TcpSocket(IntPtr ServerHandle)
        {
            this._handle = Marshal.AllocHGlobal(Sizes.TcpT);
            Util.CheckError(uv_tcp_init(this._handle));
            Util.CheckError(uv_accept(ServerHandle, this._handle));
            var handle = (uv_handle_t)Marshal.PtrToStructure(this._handle, typeof(uv_handle_t));

            this.me     = GCHandle.Alloc(this);
            handle.data = GCHandle.ToIntPtr(this.me);
            Marshal.StructureToPtr(handle, this._handle, true);
            this.Stream = new UVStream(this._handle);
        }
Пример #3
0
 //public event Action<string, string> OnExit;
 //private void HandleExit(string stdout, string stderr);
 public ChildProcess(string command)
 {
     this.File = command;
     this.CurrentWorkingDirectory = Directory.GetCurrentDirectory();
     this._stdout = Marshal.AllocHGlobal(Sizes.PipeT);
     uv_pipe_init(_stdout);
     this.StdOut = new UVStream(_stdout);
     this._stderr = Marshal.AllocHGlobal(Sizes.PipeT);
     uv_pipe_init(_stdout);
     this.StdOut = new UVStream(_stdout);
     this._handle  = Marshal.AllocHGlobal(Sizes.ProcessT);
 }