Exemple #1
0
        /// <summary>
        /// Initializes a new instance of libuv request object.
        /// </summary>
        /// <param name="baseHandle">Base handle for which this request will be executed.</param>
        /// <param name="requestType">Type of the request.</param>
        public UvRequest(TBaseHandle baseHandle, UvRequestType requestType)
            : base(_CalculateSize(requestType), _GetBaseHandleLoopThreadId(baseHandle))
        {
            this.RequestType = requestType;
            this.BaseHandle  = baseHandle;

            // Keep this handle alive while request is processing
            this._Pin            = GCHandle.Alloc(this, GCHandleType.Normal);
            this.NeedsToBeClosed = true;
        }
Exemple #2
0
 internal static IntPtr Alloc(UvRequestType type)
 {
     return Alloc(Sizeof(type));
 }
Exemple #3
0
 public CallbackPermaRequest(UvRequestType type, bool allocate)
     : this(UV.Sizeof(type), allocate)
 {
 }
Exemple #4
0
 public CallbackPermaRequest(UvRequestType type)
     : this(type, true)
 {
 }
Exemple #5
0
 internal static extern int uv_req_size(UvRequestType type);
Exemple #6
0
 internal static int Sizeof(UvRequestType type)
 {
     return uv_req_size(type);
 }
Exemple #7
0
 private static int _CalculateSize(UvRequestType requestType)
 {
     return(Libuv.uv_req_size(requestType).ToInt32());
 }
Exemple #8
0
 public static extern IntPtr uv_req_size(UvRequestType reqType);
Exemple #9
0
 public CallbackPermaRequest(UvRequestType type, bool allocate)
     : this(UV.Sizeof(type), allocate)
 {
 }
Exemple #10
0
 internal static IntPtr Alloc(UvRequestType type)
 {
     return(Alloc(Sizeof(type)));
 }
Exemple #11
0
 internal static int Sizeof(UvRequestType type)
 {
     return(uv_req_size(type));
 }
Exemple #12
0
 internal static extern int uv_req_size(UvRequestType type);
Exemple #13
0
 public CallbackPermaRequest(UvRequestType type)
     : this(type, true)
 {
 }