Inheritance: IDisposable
Ejemplo n.º 1
0
        private UvHandle(Loop loop)
        {
            _loop = loop;

            this.Status = HandleStatus.Closed;
            this.InitDelegates();
        }
Ejemplo n.º 2
0
        internal LoopWork(Loop loop, Action run, Action after, Action<LoopWork> completed)
        {
            _run = new uv_work_cb(this.Run);
            _after = new uv_after_work_cb(this.After);
            _runAction = run;
            _afterAction = after;
            _completed = completed;
            _loop = loop;
            _work = _loop.Requests.Create(uv_req_type.UV_WORK);

            try
            {
                _loop.CheckError(Uvi.uv_queue_work(_loop.Handle, _work, _run, _after));
            }
            catch (Exception)
            {
                _work = _loop.Requests.Delete(_work);
                throw;
            }
        }
Ejemplo n.º 3
0
        internal static IntPtr AllocSocketAddress(IPEndPoint endpoint, Loop loop)
        {
            IntPtr ret;

            switch (endpoint.AddressFamily)
            {
                case AddressFamily.InterNetwork:
                    ret = loop.Allocs.Alloc(Uvi.sockaddr_in_size);
                    loop.CheckError(Uvi.uv_ip4_addr(endpoint.Address.ToString(), endpoint.Port, ret));
                    break;

                case AddressFamily.InterNetworkV6:
                    ret = loop.Allocs.Alloc(Uvi.sockaddr_in6_size);
                    loop.CheckError(Uvi.uv_ip6_addr(endpoint.Address.ToString(), endpoint.Port, ret));
                    break;

                default:
                    throw new ArgumentException(String.Format("AddressFamily {0} not supported", endpoint.AddressFamily));
            }

            return ret;
        }
Ejemplo n.º 4
0
 protected UvHandle(Loop loop, int handleSize)
 {
     this.Loop = loop;
     this.Handle = this.Alloc(handleSize);
     this.Status = HandleStatus.Open;
 }
Ejemplo n.º 5
0
 protected UvHandle(Loop loop, IntPtr handle)
 {
     this.Loop = loop;
     this.Handle = handle;
     this.Status = HandleStatus.Open;
 }
Ejemplo n.º 6
0
 internal UvHandle(Loop loop, uv_handle_type handleType)
 {
     this.Loop = loop;
     this.Handle = this.Alloc(handleType);
     this.Status = HandleStatus.Open;
 }
Ejemplo n.º 7
0
 public File(Loop loop)
 {
     this.Loop   = loop;
     this.Status = FileStatus.Closed;
     this.InitDelegates();
 }
Ejemplo n.º 8
0
 internal BufferCollection(Loop loop)
 {
     _loop = loop;
 }
Ejemplo n.º 9
0
 public Filesystem(Loop loop)
 {
     this.Loop = loop;
     this.InitDelegates();
 }
Ejemplo n.º 10
0
 internal UvHandle(Loop loop, uv_handle_type handleType)
     : this(loop)
 {
     _handle = loop.Allocs.AllocHandle(handleType);
 }
Ejemplo n.º 11
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="loop">Loop</param>
 /// <param name="handleSize">Size of the <typeparamref name="Libuv.uv_stream_t"/> structure to allocate</param>
 protected UvStream(Loop loop, int handleSize)
     : base(loop, handleSize)
 {
 }
Ejemplo n.º 12
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="loop">Loop</param>
 /// <param name="handle">Pointer to a <typeparamref name="Libuv.uv_stream_t"/> structure</param>
 protected UvStream(Loop loop, IntPtr handle)
     : base(loop, handle)
 {
 }
Ejemplo n.º 13
0
 public TcpClientSocket(Loop loop)
     : base(loop)
 {
     _connectionReq = this.Loop.Requests.Create(uv_req_type.UV_CONNECT);
 }
Ejemplo n.º 14
0
 public File(Loop loop)
 {
     this.Loop = loop;
     this.Status = FileStatus.Closed;
     this.InitDelegates();
 }
Ejemplo n.º 15
0
 private static int uv_fs_open(Loop loop, IntPtr req, string path, FileAccessMode rw, FileOpenMode open, FilePermissions permissions, uv_fs_cb cb)
 {
     return Uvi.uv_fs_open(loop.Handle, req, path, (int)rw | (int)open, (int)permissions, cb);
 }
Ejemplo n.º 16
0
 public TcpServer(Loop loop)
     : base(loop, uv_handle_type.UV_TCP)
 {
     this.BackLog = DefaultBackLog;
     CheckError(Uvi.uv_tcp_init(this.Loop.Handle, this.Handle));
 }
Ejemplo n.º 17
0
 public TcpClientSocket(Loop loop)
     : base(loop)
 {
     this.Connection = this.Alloc(uv_req_type.UV_CONNECT);
 }
Ejemplo n.º 18
0
 protected FileHandle(Loop loop)
 {
     this.Loop = loop;
     this.Status = FileHandleStatus.Closed;
 }
Ejemplo n.º 19
0
 public Timer(Loop loop)
     : base(loop, uv_handle_type.UV_TIMER)
 {
     CheckError(Uvi.uv_timer_init(this.Loop.Handle, this.Handle));
     _tick = new uv_timer_cb(this.OnTick);
 }
Ejemplo n.º 20
0
 public FileStream(Loop loop)
     : base(loop)
 {
 }
Ejemplo n.º 21
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="loop"></param>
 /// <remarks>Handle type is <typeparamref name="Libuv.uv_tcp_t"/> that is a subclass of <typeparamref name="Libuv.uv_stream_t"/></remarks>
 protected TcpSocket(Loop loop)
     : base(loop, uv_handle_type.UV_TCP)
 {
     CheckError(Uvi.uv_tcp_init(this.Loop.Handle, this.Handle));
 }
Ejemplo n.º 22
0
 internal RequestCollection(Loop loop, BufferCollection buffer)
 {
     _loop = loop;
     _buffer = buffer;
 }
Ejemplo n.º 23
0
 internal UvStream(Loop loop, uv_handle_type handleType)
     : base(loop, handleType)
 {
 }
Ejemplo n.º 24
0
 private static int uv_fs_open(Loop loop, IntPtr req, string path, FileAccessMode rw, FileOpenMode open, FilePermissions permissions, uv_fs_cb cb)
 {
     return(Uvi.uv_fs_open(loop.Handle, req, path, (int)rw | (int)open, (int)permissions, cb));
 }