Synapse demos calling abstract methods lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- Bob1960evens · 2020-04-28 16:57 Hi, Does anyone know if any of the synapse demos work under Ubuntu? I am used to Delphi on Windows, but have to port an app to Linux. I have Lazarus 1.6+dfsg-1 installed on Ubuntu 16.04, running inside a VirtualBox (at the moment). I downloaded Synapse 2012-04-23, as it said that was stable, and the Indy page suggested there were issues with Linux, so I avoided that. I need to build a simple TCP server, to support comms with a configuration tool. Of the demos, ftpserv seemed likely, although the form did not open ("not a text file" - I suspect it is line end issues). I built a new form, but when I ran it I got a Run Error 211 - calling abstract method. After much trawling, I decided to try the echo demo, since someone said it worked. Again the form would not open ("not a text file"), so I built a new one, tried to run it, and it failed with the Run Error 211 again. I wondered if there were any Synapse demos that work in a Linux environment anywhere, that might demonstrate how to get started, which I can then build on to develop a working solution. Thanks. ---------------------------------------------------------------------- avra · 2020-04-28 20:08 Synapse stable is outdated and not updated for a long time. Synapse trunk is what you should use. You can also find it in OPM. http://svn.code.sf.net/p/synalist/code/trunk/ https://forum.lazarus.freepascal.org/index.php/topic,2725.msg12409.htm l#msg12409 https://forum.lazarus.freepascal.org/index.php/topic,48677.msg350793.h tml#msg350793 https://forum.lazarus.freepascal.org/index.php/topic,47288.msg338155.h tml#msg338155 https://forum.lazarus.freepascal.org/index.php/topic,23866.msg143558.h tml#msg143558 https://forum.lazarus.freepascal.org/index.php/topic,38622.15.html There is also event driven wrapper pl_SynapseVS which you can also find in OPM. ---------------------------------------------------------------------- Bob1960evens · 2020-04-28 21:31 Thanks for the assistance. Having got to http://svn.code.sf.net/p/synalist/code/trunk/, how do I download the files? There is no obvious download mechanism. And is OPM the Openresty Package Manager? ---------------------------------------------------------------------- rvk · 2020-04-28 21:35 Quote from: Bob1960evens on April 28, 2020, 11:31:58 pmHaving got to http://svn.code.sf.net/p/synalist/code/trunk/, how do I download the files? Goto the other link on the synapse ararat download page. This one https://sourceforge.net/p/synalist/code/HEAD/tree/trunk/ And use the big "download snapshot" button upper right. ---------------------------------------------------------------------- avra · 2020-04-28 22:37 Quote from: Bob1960evens on April 28, 2020, 11:31:58 pmis OPM the Openresty Package Manager?No. Online Package Manager which you can use to install many packages. Synapse is just one of them. https://wiki.freepascal.org/Online_Package_Manager ---------------------------------------------------------------------- Bob1960evens · 2020-04-29 07:37 Thanks again. I have had no success. I downloaded the files from the trunk, but still get the "calling abstract method" error. I have stripped back the project, so it just has a form with a single button that does nothing. When I add bloksock to the uses clause, without actually calling anything in it, I get the error. I have searched through bloksock, and there is a small amount of initialization code, controlled by a conditional symbol. I have switched that off, and still get the error. I tried putting breakpoints in the initialization code, but I get the error, and it doesn't seem to stop at the breakpoints. I have searched all of the units that bloksock includes, and none of them have initialization code, so it is a mystery how it is calling abstract methods, and I cannot think of any other way to find out what is going on. ---------------------------------------------------------------------- rvk · 2020-04-29 07:41 Quote from: Bob1960evens on April 29, 2020, 09:37:04 amWhen I add bloksock to the uses clause, without actually calling anything in it, I get the error. Maybe you can attach a small sample project here which shows the error. Just use the publish option under project to write the appropriate files to a directory (not all are needed), zip the files and attach to a post here. ---------------------------------------------------------------------- Bob1960evens · 2020-04-29 11:18 I have got a tiny bit further. My original blank project used the cThreads unit, so I removed that, and the error 211 disappeared. I then reverted to a project that does something. It is the echo server that came with the original synapse download. I am now in a cleft stick. The file echo.pas uses cThreads. If I include it, the program stops with the error 211 (abstract method call) and if I omit it, it stops with an error 232 (threads not supported) when I press the button on the main form. I attach a zip of the published project as requested. ---------------------------------------------------------------------- Bob1960evens · 2020-04-29 11:54 I think I may have solved the mystery. The project source has the code Code: [Select]uses   {$IFDEF UNIX}{$IFDEF UseCThreads}   cthreads,   {$ENDIF}{$ENDIF} which is added when you create a project, and it appears that UNIX is defined but UseCThreads is not. I have removed the {$IFDEF UseCThreads} and the program at least runs, without error 211 or 232. Thanks for all your efforts. ---------------------------------------------------------------------- tuyen · 2020-05-04 13:52 Quote from: Bob1960evens on April 28, 2020, 06:57:19 pmHi, Does anyone know if any of the synapse demos work under Ubuntu? I am used to Delphi on Windows, but have to port an app to Linux. I have Lazarus 1.6+dfsg-1 installed on Ubuntu 16.04, running inside a VirtualBox (at the moment). I downloaded Synapse 2012-04-23, as it said that was stable, and the Indy page suggested there were issues with Linux, so I avoided that. I need to build a simple TCP server, to support comms with a configuration tool. Of the demos, ftpserv seemed likely, although the form did not open ("not a text file" - I suspect it is line end issues). I built a new form, but when I ran it I got a Run Error 211 - calling abstract method. I can tell you, based on personal experience, that Synapse is not going to give you better results than Indy.  When was the last time Synapse received an update?  Maybe 2012? What exactly are you trying to create, and what "issues" are you referring to with Indy and Linux? I've created a number of different projects that run on Linux using Indy.  These are programs that run all day, every day, in business- critical applications, and they have no problems whatsoever.  Across the different projects, I'm using TCPClient, TCPServer, POP3, SMTP, and HTTPServer.  Some projects have all of those components together, and other projects have only some of them. I have one project that runs at the top of a mountain that is only accessible to people for approximately two months during the year.  The rest of the year, everything is buried in snow.  All communication is done by satellite, because there are no cell towers in the area.  Indy is used for all communications.  Works perfectly fine. If you use good coding practices, write clean code, don't over- complicate things, then you should have no problems.  This is true for Windows, Linux, or any other platform.