static void OnWatcherCallback(IntPtr handle, int status) { var request = GetDataFromHandle <ConnectRequest>(handle); if (status < 0) { request.error = Libuv.CreateError((uv_err_code)status); } request.OnWatcherCallback(); }
public ConnectRequest(IntPtr handle, IPEndPoint remoteEndPoint) : base(uv_req_type.UV_CONNECT, 0) { Libuv.GetSocketAddress(remoteEndPoint, out sockaddr addr); int result = Libuv.uv_tcp_connect( this.Handle, handle, ref addr, WatcherCallback); //ThrowIfError(result); if (result < 0) { error = Libuv.CreateError((uv_err_code)result); OnWatcherCallback(); } }