Recent

Author Topic: Recommended socket library?  (Read 13651 times)

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 9458
  • FPC developer.
Re: Recommended socket library?
« Reply #15 on: January 19, 2017, 10:21:01 am »
When I try to use fpsock, I get an error, it definitely does not work for me, not just hearsay  ;)
Well, it seems that you are correct and fpsock was/is not compiled for mac.

fpcmake:

(in 3.0+ the authoritative source is fpmake.pp btw, not makefile.fpc, which is only kept for certain developer purposes,
but in this case the result is the same

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 9458
  • FPC developer.
Re: Recommended socket library?
« Reply #16 on: January 19, 2017, 10:26:16 am »
Why would fpsock not work on OSX? The author has only MAC's  O:-) O:-) he is often accused of.

From fpsock.pp

Quote
Socket communication components
    Copyright (c) 2003 by
      Areca Systems GmbH / Sebastian Guenther, sg@freepascal.org


I never saw Sebastian use a Mac, except when I forced him too (he compiled QT on my mac mini during a fair in Muenchen to demonstrate the first time I saw QT Lazarus on the Mac). It took 8+ hours or so :-)

When Sebastian was active in the project (mostly before 2.0), FPC didn't even exist on the Mac. He was an avid Linux user, but did some work on Windows too due to client requests.

Of course, meanwhile 10 years have passed and he could be using nearly anything  :-)

Thaddy

  • Hero Member
  • *****
  • Posts: 10795
Re: Recommended socket library?
« Reply #17 on: January 19, 2017, 11:16:39 am »
Ah. I mixed up, Marco
Anyway, there are maintainers ;)
Can somebody else test from the sources too. Afaict fpsock (fcl-net as a whole maybe not, didn't test that) can be enabled for OSX. It is all based on lowlevel unix units and these all work on OSX. That also goes for fcl-async, which is a dependency.

Thaddy

  • Hero Member
  • *****
  • Posts: 10795
Re: Recommended socket library?
« Reply #18 on: January 19, 2017, 12:19:49 pm »
Oops:

I am examining why my code works. It's a bit of a mess.
- I copied the FreeBSD sockets sources and includes to my project directory
- I copied the fcl-net sources to my project directory
- I copied the fcl-async sources to my project directory.
- I changed the value of MSG_NOSIGNAL from $20000 to 0. I have no clue why, doesn't look right. (On Linux it is $4000 on FreeBSD and OpenBSD it is $20000, $4000 is MSG_NBIO on BSD's) I seem to remember I did that for synapse to work (which it does)

I have also messed with libc at some point, but it seems that that is not used anymore.

Even if it's a mess. It works, but I have to test and recompile. Report back later. If it STILL works I will prepare the files so it can be enabled on OSX (at least snow leopard)

ATM, unless you a prepared to take these steps,I must say I was probably wrong in over hastily recommending fpsock.  :( :( >:(
Anyway, I dusted off the mac mini  ::)
« Last Edit: January 19, 2017, 12:22:09 pm by Thaddy »

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Recommended socket library?
« Reply #19 on: January 19, 2017, 07:32:50 pm »
When I try to use fpsock, I get an error, it definitely does not work for me, not just hearsay  ;)
Well, it seems that you are correct and fpsock was/is not compiled for mac.

fpcmake:
(in 3.0+ the authoritative source is fpmake.pp btw, not makefile.fpc, which is only kept for certain developer purposes,
but in this case the result is the same
Oops, my bad. Thank you for the correction.

Trenatos

  • Hero Member
  • *****
  • Posts: 523
    • MarcusFernstrom.com
Re: Recommended socket library?
« Reply #20 on: January 20, 2017, 04:09:00 am »
@molly Nah you're not nosy, no worries.

I really appreciate the help from everyone.

I don't really know enough to see if this can just be turned back on for OSX in the official repos, would love that of course though.

I'll see if I can make my local copy work in the mean time.

Someone mentioned fpweb, I've started playing with that today, pretty neat so far, going to be fun pitting it against my usual stack and see how it performs   :)

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1521
  • Former Delphi 1-7, 10.2 user
Re: Recommended socket library?
« Reply #21 on: May 03, 2021, 12:00:21 pm »
To bring this thread to its conclusion:

* fpsock.pp is still not enabled for macOS;
* However, it compiles if you copy it to your project directory, include it in your Uses clause, and edit it to replace MSG_NOSIGNAL with SO_NOSIGPIPE and appears to work without issue.

I guess I should log a bug...
Lazarus 2.1 r65061 FPC 3.3.1 r49223 macOS 10.14.6 Xcode 11.3.1
Lazarus 2.3 r65500 FPC 3.3.1 r49634 macOS 11.5.1 aarch64 Xcode 12.5.1
Lazarus 2.1 r61574 FPC 3.3.1 r42318 FreeBSD 12.1 amd64 VMware VM
Lazarus 2.1 r61574 FPC 3.0.4 Ubuntu 20.04 Parallels VM
Lazarus 2.0.10 FPC 3.2.0 Win10 Parallels VM

 

TinyPortal © 2005-2018