sockets unit and cross platform development lazarus / 8-Other ---------------------------------------------------------------------- LacaK · 2009-09-30 07:05 Hi, there is sockets.pp unit, which has several scoket functions like : fpsocket, fpconnect, fpsend, fprecv these can I use when developing cross-platform app. But some functions, which I need also, like: gethostbyname - resolve host name to ip have no cross-platform equivalent (for example fpgethostbyname) So I must still use costruct like:  {$IFDEF WINDOWS}   use WinSock2  {$ENDIF}  {$IFDEF UNIX}   use BaseUnix, NetDB,  {$ENDIF} Can I avoid this ? Is there universal aproach ? Should I post this ("Extend sockets.pp unit to provide more cross-platform socket related functions") as feature request into Mantis tracker ? -Laco. ---------------------------------------------------------------------- Almindor · 2009-09-30 07:20 The DNS isn't unified on the low level. You can use an abstraction higher level library like lNet (http://lnet.wordpress.com), Synapse or Indy which provide a common interface to networking over various platforms. ---------------------------------------------------------------------- Ocye · 2009-09-30 09:52 BTW: It seems to me that these libs are not well maintained. (lNet: 2008/05/30, Synapse: 2007/12/21). Synapse does not work with fpc >2.2(?) since {$legacysocket} are disabled. I'm not sure which lib should be recommended. (lNet didn't work for me because the redirecting problem I ask you some weeks ago). Am I wrong, that a well maintained, easy to use, small and "lightweight", fairly integrated into Lazarus and excellent documented library is missing? In german: Eierlegendewollmilchsau (swiss army knife) ---------------------------------------------------------------------- Vincent Snijders · 2009-09-30 10:11 Not well maintained? Synapse for example may not work with fpc > 2.2, but it does work with the very latest fpc 2.2.4 release. It will work with the next fpc 2.4.0 release too, when it is released. I am sure a similar story can be told about lNet. ---------------------------------------------------------------------- Leledumbo · 2009-09-30 10:24 QuoteI am sure a similar story can be told about lNetI hope so, can't install it on my daily snapshot Lazarus 0.9.29 and FPC 2.5.1 ---------------------------------------------------------------------- Vincent Snijders · 2009-09-30 10:41 If you are using the svn version of lnet, create a bug report in the Lazarus CCR project of the Lazarus bug tracker. ---------------------------------------------------------------------- Ocye · 2009-09-30 10:55 Quote from: Vincent Snijders on September 30, 2009, 12:11:06 pm...but it does work with the very latest fpc 2.2.4 release.I cannot compile it with 2.5.1. It wasn't a problem anyway, to adapt the Synapse sources not to use legacy functions. My maintenance argument was related to the release info of Synapse, and deliberately expressed as question. I'm using it passably successful. ---------------------------------------------------------------------- LacaK · 2009-09-30 11:53 Quote from: Almindor2 on September 30, 2009, 09:20:11 amThe DNS isn't unified on the low level. You can use an abstraction higher level library like lNet Yes I know about lNet and I use it, but as mentioned lNet does not compile with FPC 2.5.x (I already reported this to LNet author and he knows about this problem, which is fixed in lNet trunk) So I still think, that it will be useful to have in sockets.pp (or somewhere in other cross-platform unit) some kind of DNS related functions and/or more socket related functions. Which will cover basic api functions, when I do not want use 3rd party components. We say that FPC/Lazarus is cross-platform , so I expect basic socket- related functions are also cross-platform. (I do not say about components etc. where LNet and Indy take place) So do you think I can post it as feature request ? or is it "off- topic"? ---------------------------------------------------------------------- LacaK · 2009-10-01 11:25 http://mantis.freepascal.org/view.php?id=14701 ---------------------------------------------------------------------- zeljko · 2009-10-25 18:47 so, anyone fixed synapse to compile with 2.5.1 ? ---------------------------------------------------------------------- Ocye · 2009-10-25 20:14 It has been fixed in the latest release 39: http://ararat.cz/synapse/doku.php/download