[SOLVED] Up to date documentation? lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- RastaManKing · 2018-11-28 00:01 a little background: i have been programing in C#, Java, and Delphi, under windows. i tried lazarus before but due to "commodity" i fell back to delphi. but now i have finally made the switch, from windows to linux, and im making a full switch lo leave close source as much as i can, im determined to leave C# and Delphi for freepascal/lazarus. the culprit: i have a personal project(C#) where i make use of raw sockets, i want to rewrite this project in freepascal with lazarus, but this time with a datagram socket. i managed to write most of my networking unit but i get many "deprecated" warnings and other troubles, for example on "NetToHost" and getting sockaddr_in instead of just sockaddr, etc.. i get all my information from " official" documentation along with their examples but i have noticed that the vast majority if not all on there seems outdated. https://www.freepascal.org/docs-html/rtl/sockets/index-5.html also in lazarus wiki the sockets unit sections has a bold sentence saying its deprecated. my question: i wonder if anyone could share with me an up to date documentation? im mainly looking for sockets unit documentation that is up to date and avoid 3rd parties. also i would like to understand, for example in C# sockets are of the "socket" type and the buffers/data is of "byte" type, but in freepascal im seeing that sockets are of "LongInt" type and buffers are of "String" type.. this puzzles me somewhat. thank you! PS: from simple mortals like me to everyone that keeps freepascal, lazarus, and this forums alive... A WORLD OF THANKS!!! ---------------------------------------------------------------------- sash · 2018-11-28 10:16 Quote from: RastaManKing on November 28, 2018, 01:01:19 amin C# sockets are of the "socket" type ..., but in freepascal im seeing that sockets are of "LongInt" type I just guess FPC's socket is a handle, while C#'s one is a wrapper/class. ---------------------------------------------------------------------- Ñuño_Martínez · 2018-11-28 10:19 AFAIK you can use the documentation for C.  FreePascal's RTL just wraps the same libraries than GCC C/C++ compiler.  Just pay attention to the type names (i.e. C's "char" is "SHORTINT" in Pascal, "float" is "SINGLE", etc.).  You can use unit ctype too. [edit] Almost the same sash said. ---------------------------------------------------------------------- marcov · 2018-11-28 11:15 In Pascal you have both high level object wrapper access (the so called socket suites like Indy and LNET, some of which are additional installs), and direct access to the (BSD) socket functions like in other lowlevel languages. Sockets are indeed a kind of handles and in practice 32-bit integers. Buffers are typically pointers to memory that you must allocate/manage. The core read and write functions are fprecv and fpsend, the rest are utility functions. The hosttonet functions are 1.0.x level functions and deprecated.  In 2005 they were replaced by more standardized htons/l like functions, so better use those for new code ---------------------------------------------------------------------- RastaManKing · 2018-11-28 16:40 thank you all for the information provided, it did help clear things up for me, im starting to realize c# is a bunch of wrappers for everything, i will just have to get used to work with handles now, its not much different i think for anyone else interested i found good documentation on linux sockets http://man7.org/linux/man-pages/man7/ip.7.html