Recent

Author Topic: Missing NSURLSession  (Read 1292 times)

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 370
Missing NSURLSession
« on: April 06, 2020, 05:59:20 pm »
I didn't find NSURLSession in Lazarus 2.0.6 for macOS. Also related objects required to work with sessions.

TFPHttpClient (OpenSSL) doesn't work correctly in Catalina.

So I searched for alternatives. Here I found ns_url_request" by Phil Hess. But it uses deprecated NSURLConnection.

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
Re: Missing NSURLSession
« Reply #1 on: April 07, 2020, 06:57:30 am »
> TFPHttpClient (OpenSSL) doesn't work correctly in Catalina.

It works if you use trunk (previously didn't work for me on FreeBSD, Linux or macOS using 3.0.x).

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 370
Re: Missing NSURLSession
« Reply #2 on: April 07, 2020, 10:36:54 am »
trev,

Thanks for your reply and advice!

I will wait for the official release of Lazarus with this improvement.

However I'm a bit concerned about OpenSSL support in future macOS versions.

On other hand, ns_url_request by Phil Hess also doesn't show a stable work, when I tested it on Catalina it hangs with timeout every 3-5 run. I have no idea why it happens. Even a simple GET request may hung with timeout exit.

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
Re: Missing NSURLSession
« Reply #3 on: April 08, 2020, 01:51:45 am »
It is FPC trunk that you need, not Lazarus. I've been using it successfully since July last year on the OS I mentioned above thanks to being pointed in the right direction by a Linux user last year. I'm not sure whether it made it into the soon-to-be released FPC 3.2.0, but I'd hope so.

You can see my multi-platform example code over here..

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 370
Re: Missing NSURLSession
« Reply #4 on: April 17, 2020, 09:58:42 am »
trev,

Thanks!

 

TinyPortal © 2005-2018