Recent

Author Topic: LNET versus INDY versus Synapse  (Read 54154 times)

jl

  • Full Member
  • ***
  • Posts: 178
LNET versus INDY versus Synapse
« on: September 17, 2010, 04:57:48 am »
Hi, i've been trying to search for a stable TCP component for lazarus that works on both Ubuntu and Windows platform.  On Windows, Indy and TWSockets are popular.  On Linux, it seems that Indy has a lot of bugs.

My coder suggested using LNET for client component, but i took a look at LNET, work seems to have stopped in 2008?  Another issue is the lack of PING, which is part of my requirement.

Hope to hear the opinion of you guys.  Thanks.  :)

j4ckr1pp3r

  • Newbie
  • Posts: 4
Re: LNET versus INDY versus Synapse
« Reply #1 on: September 17, 2010, 08:11:30 am »
my opinion: try them all :D
if you feel comfortable with vcl then try lnet http://lnet.wordpress.com/news/
for me, i feel comfortable with synapse  :D

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1927
Re: LNET versus INDY versus Synapse
« Reply #2 on: September 17, 2010, 09:50:03 am »

jarto

  • Full Member
  • ***
  • Posts: 106
Re: LNET versus INDY versus Synapse
« Reply #3 on: September 17, 2010, 04:06:52 pm »
Synapse is a very good choice when you need to be compatible with both Linux and Windows. You can use the same components and same code with both platforms and also with Delphi/Kylix.

There's one area where Indy is better: https server. The https-implementation in Synapse is not stable on Linux. I've reported the problem but not solution has been found so far:

http://www.mail-archive.com/synalist-public@lists.sourceforge.net/msg03136.html

garlar27

  • Hero Member
  • *****
  • Posts: 652
Re: LNET versus INDY versus Synapse
« Reply #4 on: September 17, 2010, 08:48:52 pm »
Using Ping on linux needs root permissions. So you will have to loggin as root or give root priviledges to the application. I think there might be other ways to do it.

OpenLieroXor

  • New Member
  • *
  • Posts: 38
Re: LNET versus INDY versus Synapse
« Reply #5 on: September 17, 2010, 09:28:19 pm »
For me Synapse is the best networking library - stable, powerful and cross-platform. About pinging, I think it's not good to do ping using ICMP sockets directly, because you need administrative (root) privileges both under Linux and Windows (however, under Windows usually you get it by default). The better solution is to use 'ping' command in the command line, because it can be performed by normal users.

Dibo

  • Hero Member
  • *****
  • Posts: 1048
Re: LNET versus INDY versus Synapse
« Reply #6 on: September 18, 2010, 01:23:40 am »
My order is:

1. LNet - if I can I always use this sockets (if I need TCP/IP it always win). Very fast and lightweight (good choice for mobile platform). Really cross platform (Windows, Windows mobile, Linux, MacOS, etc) Have no-blocking mode, but...
2. ... HTTPClient is very restricted, so I use Synapse socket (i have a total control on every part like headers, request body, response body, redirection, SSL etc). Have blocking mode so I mostly must use threads. Support only for windows and linux (and use winsock on linux?). On windows mobile (tested year ago) I had add some compiler defines manually.
3. If all else fails I use Indy - very heavy but have everything, and if something is not working on LNet/Synapse sockets, is always work on Indy

jixian.yang

  • Full Member
  • ***
  • Posts: 173
Re: LNET versus INDY versus Synapse
« Reply #7 on: September 18, 2010, 10:32:33 am »

There's one area where Indy is better: https server. The https-implementation in Synapse is not stable on Linux. I've reported the problem but not solution has been found so far:

http://www.mail-archive.com/synalist-public@lists.sourceforge.net/msg03136.html

Synapse seems stable on linux.

Please cut
"Sock.SSL.CertCAFile := ExtractFilePath(ParamStr(0)) + 's_cabundle.pem';
  Sock.SSL.CertificateFile := ExtractFilePath(ParamStr(0)) + 's_cacert.pem';
  Sock.SSL.PrivateKeyFile := ExtractFilePath(ParamStr(0)) + 's_cakey.pem';
  Sock.SSL.KeyPassword := 's_cakey';
  Sock.SSL.verifyCert := True;
"and paste it into "procedure TTCPHttpDaemon.Execute;   with sock do
"

and try again.




ahmetnurideniz

  • Full Member
  • ***
  • Posts: 110
  • As you sow, you shall reap.
    • Big Student Web Site
Re: LNET versus INDY versus Synapse
« Reply #8 on: September 18, 2010, 02:16:32 pm »
i use lnet for telnet cominicatin. i test indy telnet but it has error on my system. but may be it is my own problem. Lnet is work stable and very easy for me.
Note : i am new  network programer  :)

jarto

  • Full Member
  • ***
  • Posts: 106
Re: LNET versus INDY versus Synapse
« Reply #9 on: September 18, 2010, 08:29:26 pm »

Synapse seems stable on linux.

Please cut
"Sock.SSL.CertCAFile := ExtractFilePath(ParamStr(0)) + 's_cabundle.pem';
  Sock.SSL.CertificateFile := ExtractFilePath(ParamStr(0)) + 's_cacert.pem';
  Sock.SSL.PrivateKeyFile := ExtractFilePath(ParamStr(0)) + 's_cakey.pem';
  Sock.SSL.KeyPassword := 's_cakey';
  Sock.SSL.verifyCert := True;
"and paste it into "procedure TTCPHttpDaemon.Execute;   with sock do
"

and try again.

Yes, that's the way you add HTTPS support to Synapse. It's rock solid on Windows, but crashes on Linux under heavy traffic. I've reproduced the problem with both FPC and Kylix and on several Linux distributions.

jl

  • Full Member
  • ***
  • Posts: 178
Re: LNET versus INDY versus Synapse
« Reply #10 on: September 21, 2010, 06:17:01 pm »

Synapse seems stable on linux.

Please cut
"Sock.SSL.CertCAFile := ExtractFilePath(ParamStr(0)) + 's_cabundle.pem';
  Sock.SSL.CertificateFile := ExtractFilePath(ParamStr(0)) + 's_cacert.pem';
  Sock.SSL.PrivateKeyFile := ExtractFilePath(ParamStr(0)) + 's_cakey.pem';
  Sock.SSL.KeyPassword := 's_cakey';
  Sock.SSL.verifyCert := True;
"and paste it into "procedure TTCPHttpDaemon.Execute;   with sock do
"

and try again.

Yes, that's the way you add HTTPS support to Synapse. It's rock solid on Windows, but crashes on Linux under heavy traffic. I've reproduced the problem with both FPC and Kylix and on several Linux distributions.

How heavy is heavy?  Like 1 query per second?  Or dozens of queries per second?

Does it generate heap trace on Linux?  I seem to be getting that with Synapse on Ubuntu.  :-X

jl

  • Full Member
  • ***
  • Posts: 178
Re: LNET versus INDY versus Synapse
« Reply #11 on: September 21, 2010, 06:20:04 pm »
2. ... HTTPClient is very restricted, so I use Synapse socket (i have a total control on every part like headers, request body, response body, redirection, SSL etc). Have blocking mode so I mostly must use threads. Support only for windows and linux (and use winsock on linux?). On windows mobile (tested year ago) I had add some compiler defines manually.

Thanks for sharing.  I was told Synapse doesn't work well for multi-threading code.

jarto

  • Full Member
  • ***
  • Posts: 106
Re: LNET versus INDY versus Synapse
« Reply #12 on: September 21, 2010, 07:19:08 pm »

How heavy is heavy?  Like 1 query per second?  Or dozens of queries per second?

Does it generate heap trace on Linux?  I seem to be getting that with Synapse on Ubuntu.  :-X

Heavy means dozens or hundreds of queries per second. Check the whole thread at the link I posted earlier for details.

jarto

  • Full Member
  • ***
  • Posts: 106
Re: LNET versus INDY versus Synapse
« Reply #13 on: September 21, 2010, 07:24:12 pm »
Thanks for sharing.  I was told Synapse doesn't work well for multi-threading code.

Synapse's client code works like charm with multi-threaded code on both Windows and Linux. The only problem is if you try to create a https server with it on Linux. There's something wrong with how Synapse calls OpenSSL there.

garlar27

  • Hero Member
  • *****
  • Posts: 652
Re: LNET versus INDY versus Synapse
« Reply #14 on: September 21, 2010, 08:43:42 pm »
I use Synapse for threaded serial communication on Linux and Windows without problems.

lNet and Synapse are great components. I think it's hard to choose one. The main difference I can see is:
   lNet: higher level, event driven.
   Synapse: lower level (you can deal with the nuts and bolts).

I don't know if someone have done serious tests to compare those components.

 

TinyPortal © 2005-2018