Recent

Author Topic: Wouter van Wegen  (Read 4021 times)

pascalbythree

  • Sr. Member
  • ****
  • Posts: 256
Wouter van Wegen
« on: May 05, 2015, 12:08:28 pm »
http://www.circuitsonline.net/forum/view/message/1716545#1716545


Does anybody have blocksocket source code to open a socket/lister as a small TCP/IP server on Raspbian Linux?

Is it possible with lNet for lazarus on a Raspberry to open a Server Socket, or is it only possible to work as a client socket?
« Last Edit: May 05, 2015, 10:17:12 pm by pascalbythree »

Swirl

  • New Member
  • *
  • Posts: 24
Re: Wouter van Wegen
« Reply #1 on: August 11, 2015, 09:05:53 am »
Hallo Wouter,

yes it's (kind of) possible to run lnet components on Raspbian. It's not smart because the debugger certainly makes sense but...
You have to switch off debugging (see: -> tools -> settings -> and set debugger to <none>). Otherwise you get a "sigill" when you run your program in IDE.

Examples for a simple server (tcp/ip) you'll find in the web.
Basic usage is provided here: https://lnet.wordpress.com/usage/usage-guide/
And if you don't mind to read a german PDF look here: http://www.martinjakobs.de/media/Lazarus/Client-Server-Kommunikation-mit-LNET-und-Lazarus-26.11.2010.pdf

Regards,
Swirl
Working with Lazarus 2.0.12 - FPC 3.2.0 on Win/Mint/elementaryOS
Playing with Lazarus on macOS 10.15 / Catalina

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Wouter van Wegen
« Reply #2 on: August 11, 2015, 09:56:59 am »
Is it possible with lNet for lazarus on a Raspberry to open a Server Socket, or is it only possible to work as a client socket?
Try tcp server port greater then 1024.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

Thaddy

  • Hero Member
  • *****
  • Posts: 14382
  • Sensorship about opinions does not belong here.
Re: Wouter van Wegen
« Reply #3 on: August 11, 2015, 10:13:02 am »
I am using synapse trunk for Raspbian and it works like a charm. Synapse is a blocking sockets library.
I also have examples if you want.
« Last Edit: August 11, 2015, 11:12:07 am by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

Thaddy

  • Hero Member
  • *****
  • Posts: 14382
  • Sensorship about opinions does not belong here.
Re: Wouter van Wegen
« Reply #4 on: August 11, 2015, 11:14:24 am »
Is it possible with lNet for lazarus on a Raspberry to open a Server Socket, or is it only possible to work as a client socket?
Try tcp server port greater then 1024.

Not necessary. The Pi can happily be used as a webserver, provided the provider allows you to do that. In NL most do, otherwise use 8080/8081 which is pretty much standard.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11458
  • FPC developer.
Re: Wouter van Wegen
« Reply #5 on: August 11, 2015, 11:21:15 am »
I think Avra means that you must be root for sockets below 1024.

Thaddy

  • Hero Member
  • *****
  • Posts: 14382
  • Sensorship about opinions does not belong here.
Re: Wouter van Wegen
« Reply #6 on: August 11, 2015, 11:27:43 am »
Huh? You know what I do for a living, Marco.

But: there have to be sufficient rights. root is not necessary. No proper server runs with root rights.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

eny

  • Hero Member
  • *****
  • Posts: 1634
Re: Wouter van Wegen
« Reply #7 on: August 11, 2015, 11:47:51 am »
http://www.circuitsonline.net/forum/view/message/1716545#1716545
Ah yes, those friendly teen admins from CO: you can come in with your opinion, but we'll force you to leave with ours...
All posts based on: Win10 (Win64); Lazarus 2.0.10 'stable' (x64) unless specified otherwise...

 

TinyPortal © 2005-2018