Recent

Author Topic: Cross-Platform Socket Component?  (Read 10939 times)

KillerCode

  • New Member
  • *
  • Posts: 29
Cross-Platform Socket Component?
« on: January 04, 2011, 05:33:14 pm »
i am willing to start a big project in FreePascal/Lazarus, im also looking forward to make it cross platform (Windows, Linux and Mac OSX) and i wanted to know which is the best Sockets component that will work on all?
i was working with Indy 9/10 for under Delphi, each client has its Owen thread, is this available on lNet ? or ill have to create a thread for each client manually? or there is another library better than those two?

thanks;

Leledumbo

  • Hero Member
  • *****
  • Posts: 8760
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Cross-Platform Socket Component?
« Reply #1 on: January 04, 2011, 06:16:40 pm »
lNet for RAD style, Synapse for more OOP and advanced style. I'm a bit unsure about Mac OS X support, only Windows and Linux are totally guaranteed to work AFAIK.

Dibo

  • Hero Member
  • *****
  • Posts: 1048
Re: Cross-Platform Socket Component?
« Reply #2 on: January 04, 2011, 06:48:08 pm »
I'm using lNet and Synapse on windows and linux without problems. Works on 32 and 64 bit system. The only difference is that lNets are non-blocking sockets. Both sockets works on Windows Mobile too.

I also tested Indy before, and worked too.

Regards.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Cross-Platform Socket Component?
« Reply #3 on: January 04, 2011, 07:36:05 pm »
I was able to get Indy working on Mac with a few patches. I use it with Web Service Toolkit. However, I was never able to get Synapse working on Mac, but it's been a couple years since I tried.

If you have success (or failure) on Mac with lnet or Synapse, please post your results.

Thanks.

-Phil

KillerCode

  • New Member
  • *
  • Posts: 29
Re: Cross-Platform Socket Component?
« Reply #4 on: January 05, 2011, 06:17:02 am »
ok, thanks all, i think ill go with lNet, just one more question, is does lNet create a separate thread for each client like Indy does?
or ill have to create that manually?

thanks;

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11524
  • FPC developer.
Re: Cross-Platform Socket Component?
« Reply #5 on: January 05, 2011, 02:10:06 pm »
I've done some stuff with Indy(10) on Mac in the past, and that worked fine.

Dibo

  • Hero Member
  • *****
  • Posts: 1048
Re: Cross-Platform Socket Component?
« Reply #6 on: January 05, 2011, 02:30:17 pm »
ok, thanks all, i think ill go with lNet, just one more question, is does lNet create a separate thread for each client like Indy does?
or ill have to create that manually?

thanks;
It doesn't use threads. It uses callback events (see demos). More on:
http://wiki.lazarus.freepascal.org/lNet
FAQ and basic usage:
http://lnet.wordpress.com/

Leledumbo

  • Hero Member
  • *****
  • Posts: 8760
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Cross-Platform Socket Component?
« Reply #7 on: January 05, 2011, 06:23:59 pm »
It uses non-blocking sockets, so probably you don't need any thread at all.

KillerCode

  • New Member
  • *
  • Posts: 29
Re: Cross-Platform Socket Component?
« Reply #8 on: January 06, 2011, 02:30:38 pm »
ok ty, ill give the console version a try

Leledumbo

  • Hero Member
  • *****
  • Posts: 8760
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Cross-Platform Socket Component?
« Reply #9 on: January 07, 2011, 07:51:25 am »
You should try the gui one, console blocks when asking for input so you probably won't notice anything if a message comes when the app is blocking for input.

 

TinyPortal © 2005-2018