/// <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; }
internal static IntPtr Alloc(UvRequestType type) { return Alloc(Sizeof(type)); }
public CallbackPermaRequest(UvRequestType type, bool allocate) : this(UV.Sizeof(type), allocate) { }
public CallbackPermaRequest(UvRequestType type) : this(type, true) { }
internal static extern int uv_req_size(UvRequestType type);
internal static int Sizeof(UvRequestType type) { return uv_req_size(type); }
private static int _CalculateSize(UvRequestType requestType) { return(Libuv.uv_req_size(requestType).ToInt32()); }
public static extern IntPtr uv_req_size(UvRequestType reqType);
internal static IntPtr Alloc(UvRequestType type) { return(Alloc(Sizeof(type))); }
internal static int Sizeof(UvRequestType type) { return(uv_req_size(type)); }