Net programming newbee lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- Raul_ES · 2019-05-11 00:10 Hi guys, please, can you recommend a newbee which library you would choose to start network programming? I am just finishing a course on networking basics here at the faculty, but all in C and Java... I am reading about Synapse, Lnet... but I have a bit of confusion. I just want to start with basic tcp/udp sockets programming and such. thank you all, regards ---------------------------------------------------------------------- marcov · 2019-05-11 10:52 For simple stuff I generally use lnet because it is simple and build in. For more complicated, production stuff I use indy. You can also try to write everything at sockets level, which can be quite a good learning experience. ---------------------------------------------------------------------- lucamar · 2019-05-11 11:21 Why not use the built-in sockets, fcl-net and fcl-web? Those are the base buiding blocks for network programming and are already included in FPC. ---------------------------------------------------------------------- sash · 2019-05-12 11:39 Quote from: Raul_ES on May 11, 2019, 02:10:20 amrecommend a newbee which library you would choose to start network programming ... I have a bit of confusion. I just want to start with basic tcp/udp sockets programming and such. I have a confusion about word "basic" too. Because "basic tcp/udp sockets" is not what I'd recommend to programmer with just basic skills. Instead, I'd consider a higher level library, like  fcl-net/web, Synapse, Indy (listed in order of external dependencies handling easiness). ---------------------------------------------------------------------- lucamar · 2019-05-12 13:48 Quote from: sash on May 12, 2019, 01:39:48 pmI have a confusion about word "basic" too. Because "basic tcp/udp sockets" is not what I'd recommend to programmer with just basic skills. Note that, although a varsity student, he doesn't says he has "basic skills" as programmer but only in the network programing area, and he says he has just ended a course so now he wants to apply to Pascal what he learned with C/Java. Also, there's not much mistery in using socket objects from a programming point of view. The difficulties come (usually) with stablishing connections, managing protocols, etc. which is basically what low-level network programming is about. ---------------------------------------------------------------------- Raul_ES · 2019-05-12 21:33 Thank you friends, exactly lucamar, I would like to repeat the class exercises  but with pascal/object pascal this time. The homework teachers order us to do is, for instance, "read the RFC 867 (daytime protocol) and write in Java a udp implementation of a client and a server. Then repeat with tcp socket programming but in C." Everything was done during the course with pure socket coding. Obviously you require to have a certain programming skill. The fact is that you cannot take the course without taking before all the courses about programming, computer structure and operating systems. Too much theory! Now I need more practicing with my favorite language :-) regards ---------------------------------------------------------------------- Raul_ES · 2019-05-12 21:34 Quote from: lucamar on May 11, 2019, 01:21:19 pmWhy not use the built- in sockets, fcl-net and fcl-web? Those are the base buiding blocks for network programming and are already included in FPC. excuse me, it's the same thing lnet and fcl-net ?? ---------------------------------------------------------------------- Raul_ES · 2019-05-12 21:39 Quote from: marcov on May 11, 2019, 12:52:29 pmFor simple stuff I generally use lnet because it is simple and build in. For more complicated, production stuff I use indy. You can also try to write everything at sockets level, which can be quite a good learning experience. thanks marcov I have just found a very interesting sample project in Indy called SimpleString_Exchange client & server. Anyway, probably the best academical option would be to code from "scratch" with sockets. Regards. ---------------------------------------------------------------------- lucamar · 2019-05-12 22:29 Quote from: Raul_ES on May 12, 2019, 11:34:46 pmexcuse me, it's the same thing lnet and fcl-net ?? No, not quite LNET is a third-party, lightweight, Pascal networking lib someone wrote; somehow like Indy and Synapse but with more humble expectatives. FCL-NET is part of FPC's FCL and contains base networking capabilities: netdb, bare sockets, DNS lookup, URI parser, etc. You'll find its source in the directory (FPCSource)/packages/fcl-net/. FCL-WEB builds over fcl-net to implement a higher level web interface which allows to build easily web clients/servers, CGI programs, Apache modules, and a lot more things. Source in (FPCSource)/packages/fcl- web/ Quote from: Raul_ES on May 12, 2019, 11:39:42 pm[...] probably the best academical option would be to code from "scratch" with sockets. All libraries implement standard sockets (each in its own way, but very similar one to another), but probebly the best option if you want to start from scratch is to use fcl-net. Once you're comfortable with that, you can easily "graduate" to the base sockets implementation in Indy or Synapse (or LNet). From there, the Moon is the limit ---------------------------------------------------------------------- Handoko · 2019-05-13 01:55 Just for information, fcl-web (TFPHTTPClient) has SSL issue with recent version of Ubuntu (19.10). Some suggestions are available but I haven't tried yet. https://forum.lazarus.freepascal.org/index.php/topic,39206.msg320591.h tml#msg320591