Difference between revisions of "lNet"

From Lazarus wiki
Jump to navigationJump to search
 
(169 intermediate revisions by 19 users not shown)
Line 1: Line 1:
===About===
+
{{LNet}}
lNet or LightWeight Networking Library is a collection of classes and components to enable event-driven TCP or UDP networking. lNet is released under a modified LGPL license. (permits static linking)
 
  
 +
==About==
 +
'''lNet''' or '''Lightweight Networking Library''' is a collection of classes and components to enable event-driven TCP or UDP networking.
  
The package consists of base lNet units library, lThreadNet library for multithreading and lNetComponents libraries for providing visual and non-visual components for networking.
+
Authors:
 +
* Ales Katona ([[User: Almindor]])
 +
* Micha Nelissen
  
These components were tested in Win32 and Linux. They should however run on any major platform supported by FPC.
+
License: modified LGPL license (permits static linking).
Homepage of the lNet base libraries is: http://members.chello.sk/ales
 
  
As of version 0.2 the package consists of multi-threaded (MT) and single-threaded(ST) versions. I strongly advise installing the ST version as it's less bug prone, doesn't require special hacks(see installation) to work and uses new LCL [http://wiki.lazarus.freepascal.org/index.php/Main_Loop_Hooks features] to work.
+
==Download==
 +
There are two variants of the library, which are no longer completely synchronised:
  
===Author===
+
* [http://sourceforge.net/projects/lazarus-ccr/files/lNet/ lNet package]. Packaged as utilities for the use of the FPC project itself. They are not recommended for general use.
Ales Katona ([[User: Almindor]])
+
* At http://lnet.wordpress.com, however this advises that the project has been moved to GitHub https://github.com/almindor/lnet.
  
===License===
+
You can contact the author directly by email or go to #lnet channel on freenode.
Modified LGPL (read LICENSE and LICENSE.ADDON included in package).
 
 
===Download===
 
  
* [http://sourceforge.net/project/showfiles.php?group_id=92177&package_id=98986&release_id=370680| lNet package]
+
== Usage ==
  
===Change Log===
+
Drop a TLTCPComponent or TLUDPComponent on a form. Assign OnAccept, OnError, OnReceive, OnConnect and OnDisconnect event handlers. Note that this is optional but in most
* Version 0.2.0 29.11.2005
+
cases required for functionality.
* Version 0.1.0 12.11.2005
 
  
===Roadmap===
+
Client connection is initialized with the Connect call. Arguments are IP address/hostname and port respectivly. Non-blocking connect is used, this means that you '''DON'T''' know that you're connected until OnConnect event is fired.
* Stress testing
 
* Addition of input and output streaming classes/components
 
* Addition of Telnet components
 
  
===Dependencies / System Requirements===
+
Server connection is initialized with the Listen* call. Argument is port.
* MT - Lazarus 0.9.10 (FPC 2.0.2)
 
* ST - Lazarus 0.9.11 (FPC 2.0.0)
 
  
Status: Alpha
+
{{Note| address is a string representation of IP eg: '127.0.0.1' or a hostname like 'localhost'.}}
  
Issues:
+
Sending data to the other side is accomplished with the Send/SendMessage method.
Tested on Windows (WinXP) and Linux (Kubuntu Breezy Badger).
 
  
===Installation===
+
===Events of TLNetComponent===
'''I STRONGLY ADVISE USING THE ST VERSION'''
+
 
* In the lazarus/components directory, unzip the files from lnetpackage-<version>.zip file. The lNetpackage-<version> folder will be created.
+
* OnError - this event is fired whenever a connection error occurs. If no handler is assigned an excepion with "msg" is raised. Arguments are: msg - contains string and numerical representation of error message formatted in native encoding or UTF8 (depending on ForceUTF8 property). aSocket is the socket at which the error occured, nil means that the error is not a socket specific one.
* Open lazarus
+
 
* '''WINDOWS USERS ONLY WITH MT VERSION''': There's an inconsistency in FPC about threading on the unix platform. This is the reason for -Facthreads switch which is forced by the lnetpackage.lpk. On windows this unit does not exist. For now there is no other solution but to manually remove this dependency from lnetpackage.lpk. Open lnetpackage-0.2-mt/lnetpackage.lpk, go to options/custom and remove the -Facthreads line. Then save the package. This ugly procedure will be removed when lazarus adds the possibility to add platform specific compiler switches. I strongly avise you to use the ST version which doesn't require this step.
+
* OnConnect - This event is fired when the client succesfuly connects. aSocket is the socket which connected. It should serve as the "start" point for clients.
* Open the package lnetpackage-0.2-<MT/ST>/lnetpackage.lpk with Component/Open package file (.lpk)
+
 
 +
* OnAccept - this event is fired whenever a connection is accepted on a server. If no handler is assigned nothing is done. aSocket contains the socket which accepted the connection.
 +
 
 +
* OnDisconnect - this event is fired whenever a connection is lost. If no handler is assigned nothing is done. aSocket contains the socket which got disconnected.
 +
 
 +
* OnReceive - This event is fired whenever new data is '''ready to be received'''. If no handler is assigned nothing is done, but a system buffer fill may happen which will in turn fire an OnError event. aSocket is the socket at which the data got received. Data is read by Get/GetMessage method.
 +
 
 +
* OnCanSend - This event is fired whenever new data can be sent again on a socket, after a call to send function failed, returning 0. It can be used to automate sending of big chunks. aSocket is socket on which send can be called.
 +
 
 +
== Documentation ==
 +
 
 +
Documentation of lNet is partially done. You can also use Jesus' diagrams of classes and units as basic reference.
 +
 
 +
Documentation of eventer and TCP/UDP protocols: http://members.chello.sk/ales/docs ([https://web.archive.org/web/20230000000000*/http://members.chello.sk/ales/docs Archived version at archive.org]}<br>
 +
 
 +
Overview diagrams can be found here: http://members.chello.sk/ales/docs/diagrams/overview.html<br>
 +
Pictures: <br>
 +
[http://members.chello.sk/ales/docs/diagrams/inheritance_composition.png New class diagram]<br>
 +
[http://members.chello.sk/ales/docs/diagrams/extra/allclasses.png All classes]<br>
 +
[http://members.chello.sk/ales/docs/diagrams/extra/lnetunits.png lNet units]<br>
 +
[http://members.chello.sk/ales/docs/diagrams/extra/lnetunits2.png lNet units 2]<br>
 +
 
 +
Docs Mirror and Ongoing Notes: http://z505.com/cgi-bin/powtils/docs/1.6/idx.cgi?file=lnetlufdoc
 +
 
 +
== Installation ==
 +
LNet 0.5+:
 +
* In the lazarus/components directory, unzip the files from lnet-<version>.zip file. The lnet-<version> folder will be created.
 +
* Open Lazarus
 +
* Open the package lnet-<version>/lazaruspackage/lnetvisual.lpk with Package/Open package file (.lpk)
 +
* Click on Use/Install and answer 'Yes' when you are asked about Lazarus rebuilding. A new tab named 'lNet' will be created in the components palette.
 +
{{Note| users who don't want to depend on LCL but use LNet in Lazarus (non-visually), can just compile lnetbase.lpk, which adds all the base units to path.}}
 +
 
 +
LNet 0.4:
 +
* In the lazarus/components directory, unzip the files from lnet-<version>.zip file. The lnet-<version> folder will be created.
 +
* Open Lazarus
 +
* Open the package lnet-<version>/lazaruspackage/lnetpackage.lpk with Package/Open package file (.lpk)
 
* Click on Compile
 
* Click on Compile
* Open the package lnetpackage-0.2-<MT/ST>/ide/lnetidepackage.lpk with Component/Open package file (.lpk)
+
* Open the package lnet-<version>/lazaruspackage/ide/lnetidepackage.lpk with Package/Open package file (.lpk)
* Click on Install and answer 'Yes' when you are asked about Lazarus rebuilding. A new tab named 'lNet' will be created in the components palette.
+
* Click on Use/Install and answer 'Yes' when you are asked about Lazarus rebuilding. A new tab named 'lNet' will be created in the components palette.
 +
{{Note| older lNet is extraced to "lnetpackage" dir. Since 0.4.0 the "visual" and "non visual" packages are in one distribution file.}}
 +
 
 +
==Package contents==
 +
The package consists of base lNet units library, lTelnet for telnet protocol, lFTP for ftp protocol and lNetComponents libraries for providing visual and non-visual components for networking. As of 0.4.0 lHTTP and lSMTP components have been added. Since 0.5.1 there's a MIME support as part of the library mainly for creation of multipart messages for SMTP. Since 0.6.0 lNet supports SSL in a modular way, and SMTP protocol has been extended to full support of SSL/TLS (including runtime STARTTLS negotiation). HTTPS client side is supported too.
 +
 
 +
==Testing==
 +
The non-visual console components were tested on Win32, Win64, Linux_x86_32, Linux_x86_64, Linux_PPC, Linux_PPC_64, Linux_ARM* (2.1.4+) and FreeBSD_x86_32.
 +
The visual (Lazarus packages) components were tested in Win32, Win64, ARM/WinCE, Linux_x86_32, Linux_x86_64 and FreeBSD_x86_32. (gtk1 and gtk2 on unix platforms)
 +
 
 +
==History==
 +
 
 +
* March 2011: A new version of lNet was just released. 0.6.5 completes SSL and IPv6 support including server-side and per-socket (for SSL) setting. SSL and IPv6 bugs were fixed as well as some remaining disconnect problems related to server bind errors and lingering sockets. DecodeURL bug introduced in 0.6.4 was also fixed.
  
===Usage===
+
* May 2010: A new version of lNet was just released. 0.6.4 adds Qt4 support inside Lazarus (lazarus latest trunk needed, 0.9.30 should be 1st stable with it). There were also numerous fixes (http URL parsing, FTP problems) and one major bug fixed (WinCE compilation with FPC 2.4.0+). Grab it at SVN, packages will be uploaded ASAP.
Drop a TLTCPComponent or TLUDPComponent on a form.
 
Assign OnAccept, OnError, OnReceive and OnDisconnect event handlers. Note that this is optional but in most
 
cases required for functionality. Note also that if you don't assign OnError it will throw an exception in such case when a connection error occurs.
 
  
Optional properties you may set are:
+
* February 2010: Well there’s a skip in dates. Anyways version 0.6.3 of lNet has been released, you can find it in the downloads section. There’s been various bugfixes and file renames to avoid FPC conflicts. I didn’t find the time to do the QT4 port as I wanted but it’s in the works now. Some SSL fixes were made as well.
  
* Buffersize - this is the maximum size a buffer can hold per-one receive (note that assigning big number may produce random result. OS buffer is limited to 65k normaly)
+
* May 2008: Where to begin? This is a HUGE critical bugfix release. There was about 5 big bugs fixed in SSL section, one logical oversight in Session support. OpenSSL unit was added so WinCE compiles again and SMTP and FTP got bugs fixed in regards to possible desynchronization. I'd urge everyone who uses 0.6.x to update ASAP, but some bugs are also from 0.5.x (specifically the SMTP and FTP event deadlock problem).
* MaxMsgs - this is the maximum number of messages a receive buffer can hold. It's a security limit.
 
  
Client connection is initialized with the Connect call. Arguments are IP address/hostname and port respectivly.
+
* May 2008: It seems that due to an oversight in what's packaged with FPC and for which platform, lNet 0.6.x doesn't currently compile on WinCE due to missing OpenSSL unit. The unit is in fpc 2.2.0, but is not compiled for that platform yet (it is in 2.2.1+). I will add the unit to lNet and release 0.6.2 shortly, but until then, WinCE users can work around this by copying [http://svn.freepascal.org/svn/fpc/trunk/packages/openssl/src/openssl.pas this file] into their lnetdir/lib directory. (same will be done in 0.6.2 so don't worry)
  
Server connection is initialized with the Listen* call. Argument is port.
+
* April 2008: 0.6.1 has been released today. This release fixes an ugly SSL logical bug in regards to the mandatory requirements of Certificate Authority List file and Keyfile proprties of SSLSession. They are no longer needed for normal SSL to work. A minor change in HTTP and handling of SSLSession are also present.
 +
 
 +
== Stability ==
 +
 
 +
* Base lNet TCP/UDP - stable
 +
* Telnet Client - stable*
 +
* FTP Client - stable*
 +
* SMTP Client - stable
 +
* HTTP Client - stable
 +
* HTTP Server - experimental
 +
* MIME streams - stable
 +
* SSL support (client-side) - stable
 +
* SSL support (server-side) - stable (0.6.5+)
 +
* IPv6 support - stable (0.6.5+)
 +
 
 +
<nowiki>*</nowiki> FTP and Telnet still need some additional features like authentication methods.
 +
 
 +
On Linux, since you start using LNet, GDB can crash randomly (upon compilations) with diverse kind of reports. Setting debugger to Automatic in both lnetbase and lnetvisual package's options fixes the issue.
  
Note: address is a string representation of IP eg: '127.0.0.1' or a hostname like 'localhost'.
+
== Roadmap ==
 +
Items that are <s>struck through</s> have been completed in the indicated version:
 +
* Stress testing [always]
 +
* <s>Addition of Telnet and FTP clients (experimental level) [0.3]</s> (done)
 +
* <s>Cementing of TCP/UDP API [0.3]</s> (done)
  
Sending data to the other side is accomplished with the SendMessage method. Arguments are data to be sent in string form.
+
* Addition of ICMP Ping/Traceroute protocol [na] (cancelled due to various reasons*)
 +
* <s>Addition of SMTP, HTTP components [0.4]</s> (done)
 +
* <s>Stabilization of Telnet and FTP clients [0.5]</s> (done)
 +
* <s>Addition of MIME streams [0.5.1]</s> (done)
 +
* Addition of Telnet and FTP servers (experimental level) [???]
 +
* <s>Addition of SSL [0.6+]</s> (done)
 +
* Addition of Carbon and/or Cocoa widget set support [0.7+]
 +
* <s>Addition of Qt4 widget set support [0.6.4+]</s> (done)
 +
* Cleanup of SSL/HTTP (so pure HTTP doesn't depend on TLSSLSocket) [0.6.x?]
  
Note: Currently the components are limited. I will add input and output classes/components for better handling later.
+
<nowiki>*</nowiki> PING requires raw sockets which are only accessible to root on unix/linux platforms. It was decided that lNet won't support this, users who need PING should use the ping and ping6 programs via TProcess.
  
'''Events of TLNetComponent class.'''
+
== Requirements ==
 +
LNet 0.6+:
 +
* Lazarus 0.9.24+ and FPC 2.2.0+
 +
* Status: Beta
 +
* Issues: Completely tested on Windows (WinXP), Linux (Ubuntu 7.10). FastCGI considered broken for now.
  
* OnError - this event is fired whenever a connection error occurs. If no handler is assigned an excepion with "Data" is raised. Arguments are: Data - contains string and numerical representation of error message formatted in native encoding or UTF8 (depending on ForceUTF8 property). aSocketNumber is the socket at which the error occured, nil means that the error is not a socket specific one.
+
LNet 0.5:
 +
* Lazarus 0.9.22+ and FPC 2.0.4+
 +
* Status: Beta
 +
* Issues: Completely tested on Windows (WinXP), Linux (Ubuntu 6.10) and FreeBSD 5.5. FastCGI considered broken for now. <b>WinCE requires Lazarus 0.9.23+ to compile!</b>
  
* OnAccept - this event is fired whenever a connection is accepted on a server. If no handler is assigned nothing is done. Data contains the informational message in english. aSocket contains the socket which accepted the connection.
+
LNet 0.4:
 +
* Lazarus 0.9.18+ and FPC 2.0.4+
 +
* Status: Beta
 +
* Issues: Completely tested on Windows (WinXP), Linux (Ubuntu 6.06LTS) and FreeBSD 6.1. HTTP server has issues under high load with fastcgi usage. FastCGI works only in Linux for now.
  
* OnDisconnect - this event is fired whenever a connection is lost. If no handler is assigned nothing is done. Data contains the informational message in english. aSocket contains the socket which got disconnected.
+
=== Ubuntu special notice ===
  
* OnReceive - this event is fired whenever new data is received. If no handler is assigned nothing is done, but a system buffer fill may happen which will in turn fire an OnError event. Data contains the received data. aSocket is the socket at which the data got received.
+
Some "missing files" are, in fact, in the "/net" subfolder and are not found by the fpc compiler. Simply copy missing files from the subfolder (lnet.pas, tomwinsock.pas, lfunc.inc...) "/usr/lib/lazarus/components/lnetpackage/lnet" in the "/usr/lib/lazarus/components/lnetpackage" folder (adjust paths as necessary). Then complete the setup by following the installation procedure. (by Steph12358)
  
'''API CHANGES''':* There have been some API changes from 0.1 to 0.2. These were required and should improve the usability of packages. I know API changes are always a PITA but I'll try to keep them minimal from now on. Version 0.3 will be the first beta from which API will remain unchanged (only adding new stuff will be possible).
+
== API changes ==
  
 +
'''0.1 to 0.2'''
 +
* There have been some API changes from 0.1 to 0.2. These were required and should improve the usability of packages. I know API changes are always a PITA but I'll try to keep them minimal from now on. Version 0.3 will be the first beta from which API will remain unchanged (only adding new stuff will be possible).
 
* OnRecieve() changed to OnReceive()
 
* OnRecieve() changed to OnReceive()
 
* Accept() changed to Listen()
 
* Accept() changed to Listen()
 +
* All events' arguments changed. SocketNumber (int) got changed into aSocket(TLSocket) because of logical and speed reasons
 +
 +
'''0.2 to 0.3'''
 +
* Added OnCanSend and OnConnect. Connect is now non-blocking.
 +
* Removed buffersize and maxmsgs. Buffersize is no longer required because no internal buffer is used.
 +
 +
'''0.3 to 0.4'''
 +
* Lots of additions. Only "breakage" is that TLSocket.Port got changed into TLSocket.LocalPort and TLSocket.PeerPort for consistency reasons.
 +
 +
'''0.4 to 0.5'''
 +
* We did some API cleanup which resulted in API breakage.
 +
* All "connection" classes now descend from TLComponent
 +
* TLSocket now has a .Creator which is a TLComponent property specifying the creator (eg: TLTcp), so you can see now which socket in an event belongs to which connection.
 +
* Added "Connect()" and "Listen()" parameterless calls to all connections. This is mostly to enable Lazarus visual style, so people can use .Host and .Port properties and repeatedly just call ".Connect()" for example.
 +
* Added "StatusSet" set to SMTP and FTP components. This enables you to monitor specific FTP or SMTP actions and their results with events OnSuccess and OnFailure. You set the events to be watched in the set, and get results in one of the callbacks.
 +
* <b>Changed ALL callbacks which didn't use TLSocket as sender to use it. This means all FTP, SMTP and HTTP events which had "Sender: TL<HigherType>" were reverted to basic Socket style callbacks!</b>
 +
 +
'''0.5.4- to 0.5.5+'''
 +
* Some minor API changes were made which shouldn't break anything but I list them to be on the safe side.
 +
* .Timeout property on eventers and connections was set to Integer (from DWord) to support -1 as "block until an event happens"
 +
 +
'''0.5 to 0.6'''
 +
* No changes in public API, only additions.
 +
 +
'''Note for 0.4.0''': In version 0.4.0, I forgot to move lHTTPSettings unit from lib to the http example. It was NOT supposed to be a part of the library, just the example. DON'T use this, it's not a "library", it's a part of the example (http server will get it's own project later)
 +
 +
== lNet for FreeBSD, Linux, macOS and Windows ==
 +
 +
* [https://github.com/trevoz/lnet lNet for FreeBSD, Linux, macOS and Windows]
 +
** Many changes so that the library will now compile on the above with FPC 3.2.2 or FPC 3.3.1.
 +
** TLSv1.3 added
 +
** Linux TLS is not working due to an epoll problem in the file <tt>lib/sys/lepolleventer.inc</tt>
 +
** The console examples compile (I have tested the SMTP example which was what I was after).
 +
** The visual component examples do not compile for macOS - there are no Cocoa, or even defunct Carbon, interface bindings.
 +
 +
== See also ==
 +
 +
* [[lNet examples]]
 +
 +
[[Category:Components]]
 +
[[Category:Networking]]

Latest revision as of 16:33, 5 September 2023

English (en) русский (ru)

About

lNet or Lightweight Networking Library is a collection of classes and components to enable event-driven TCP or UDP networking.

Authors:

License: modified LGPL license (permits static linking).

Download

There are two variants of the library, which are no longer completely synchronised:

You can contact the author directly by email or go to #lnet channel on freenode.

Usage

Drop a TLTCPComponent or TLUDPComponent on a form. Assign OnAccept, OnError, OnReceive, OnConnect and OnDisconnect event handlers. Note that this is optional but in most cases required for functionality.

Client connection is initialized with the Connect call. Arguments are IP address/hostname and port respectivly. Non-blocking connect is used, this means that you DON'T know that you're connected until OnConnect event is fired.

Server connection is initialized with the Listen* call. Argument is port.

Light bulb  Note: address is a string representation of IP eg: '127.0.0.1' or a hostname like 'localhost'.

Sending data to the other side is accomplished with the Send/SendMessage method.

Events of TLNetComponent

  • OnError - this event is fired whenever a connection error occurs. If no handler is assigned an excepion with "msg" is raised. Arguments are: msg - contains string and numerical representation of error message formatted in native encoding or UTF8 (depending on ForceUTF8 property). aSocket is the socket at which the error occured, nil means that the error is not a socket specific one.
  • OnConnect - This event is fired when the client succesfuly connects. aSocket is the socket which connected. It should serve as the "start" point for clients.
  • OnAccept - this event is fired whenever a connection is accepted on a server. If no handler is assigned nothing is done. aSocket contains the socket which accepted the connection.
  • OnDisconnect - this event is fired whenever a connection is lost. If no handler is assigned nothing is done. aSocket contains the socket which got disconnected.
  • OnReceive - This event is fired whenever new data is ready to be received. If no handler is assigned nothing is done, but a system buffer fill may happen which will in turn fire an OnError event. aSocket is the socket at which the data got received. Data is read by Get/GetMessage method.
  • OnCanSend - This event is fired whenever new data can be sent again on a socket, after a call to send function failed, returning 0. It can be used to automate sending of big chunks. aSocket is socket on which send can be called.

Documentation

Documentation of lNet is partially done. You can also use Jesus' diagrams of classes and units as basic reference.

Documentation of eventer and TCP/UDP protocols: http://members.chello.sk/ales/docs (Archived version at archive.org}

Overview diagrams can be found here: http://members.chello.sk/ales/docs/diagrams/overview.html
Pictures:
New class diagram
All classes
lNet units
lNet units 2

Docs Mirror and Ongoing Notes: http://z505.com/cgi-bin/powtils/docs/1.6/idx.cgi?file=lnetlufdoc

Installation

LNet 0.5+:

  • In the lazarus/components directory, unzip the files from lnet-<version>.zip file. The lnet-<version> folder will be created.
  • Open Lazarus
  • Open the package lnet-<version>/lazaruspackage/lnetvisual.lpk with Package/Open package file (.lpk)
  • Click on Use/Install and answer 'Yes' when you are asked about Lazarus rebuilding. A new tab named 'lNet' will be created in the components palette.
Light bulb  Note: users who don't want to depend on LCL but use LNet in Lazarus (non-visually), can just compile lnetbase.lpk, which adds all the base units to path.

LNet 0.4:

  • In the lazarus/components directory, unzip the files from lnet-<version>.zip file. The lnet-<version> folder will be created.
  • Open Lazarus
  • Open the package lnet-<version>/lazaruspackage/lnetpackage.lpk with Package/Open package file (.lpk)
  • Click on Compile
  • Open the package lnet-<version>/lazaruspackage/ide/lnetidepackage.lpk with Package/Open package file (.lpk)
  • Click on Use/Install and answer 'Yes' when you are asked about Lazarus rebuilding. A new tab named 'lNet' will be created in the components palette.
Light bulb  Note: older lNet is extraced to "lnetpackage" dir. Since 0.4.0 the "visual" and "non visual" packages are in one distribution file.

Package contents

The package consists of base lNet units library, lTelnet for telnet protocol, lFTP for ftp protocol and lNetComponents libraries for providing visual and non-visual components for networking. As of 0.4.0 lHTTP and lSMTP components have been added. Since 0.5.1 there's a MIME support as part of the library mainly for creation of multipart messages for SMTP. Since 0.6.0 lNet supports SSL in a modular way, and SMTP protocol has been extended to full support of SSL/TLS (including runtime STARTTLS negotiation). HTTPS client side is supported too.

Testing

The non-visual console components were tested on Win32, Win64, Linux_x86_32, Linux_x86_64, Linux_PPC, Linux_PPC_64, Linux_ARM* (2.1.4+) and FreeBSD_x86_32. The visual (Lazarus packages) components were tested in Win32, Win64, ARM/WinCE, Linux_x86_32, Linux_x86_64 and FreeBSD_x86_32. (gtk1 and gtk2 on unix platforms)

History

  • March 2011: A new version of lNet was just released. 0.6.5 completes SSL and IPv6 support including server-side and per-socket (for SSL) setting. SSL and IPv6 bugs were fixed as well as some remaining disconnect problems related to server bind errors and lingering sockets. DecodeURL bug introduced in 0.6.4 was also fixed.
  • May 2010: A new version of lNet was just released. 0.6.4 adds Qt4 support inside Lazarus (lazarus latest trunk needed, 0.9.30 should be 1st stable with it). There were also numerous fixes (http URL parsing, FTP problems) and one major bug fixed (WinCE compilation with FPC 2.4.0+). Grab it at SVN, packages will be uploaded ASAP.
  • February 2010: Well there’s a skip in dates. Anyways version 0.6.3 of lNet has been released, you can find it in the downloads section. There’s been various bugfixes and file renames to avoid FPC conflicts. I didn’t find the time to do the QT4 port as I wanted but it’s in the works now. Some SSL fixes were made as well.
  • May 2008: Where to begin? This is a HUGE critical bugfix release. There was about 5 big bugs fixed in SSL section, one logical oversight in Session support. OpenSSL unit was added so WinCE compiles again and SMTP and FTP got bugs fixed in regards to possible desynchronization. I'd urge everyone who uses 0.6.x to update ASAP, but some bugs are also from 0.5.x (specifically the SMTP and FTP event deadlock problem).
  • May 2008: It seems that due to an oversight in what's packaged with FPC and for which platform, lNet 0.6.x doesn't currently compile on WinCE due to missing OpenSSL unit. The unit is in fpc 2.2.0, but is not compiled for that platform yet (it is in 2.2.1+). I will add the unit to lNet and release 0.6.2 shortly, but until then, WinCE users can work around this by copying this file into their lnetdir/lib directory. (same will be done in 0.6.2 so don't worry)
  • April 2008: 0.6.1 has been released today. This release fixes an ugly SSL logical bug in regards to the mandatory requirements of Certificate Authority List file and Keyfile proprties of SSLSession. They are no longer needed for normal SSL to work. A minor change in HTTP and handling of SSLSession are also present.

Stability

  • Base lNet TCP/UDP - stable
  • Telnet Client - stable*
  • FTP Client - stable*
  • SMTP Client - stable
  • HTTP Client - stable
  • HTTP Server - experimental
  • MIME streams - stable
  • SSL support (client-side) - stable
  • SSL support (server-side) - stable (0.6.5+)
  • IPv6 support - stable (0.6.5+)

* FTP and Telnet still need some additional features like authentication methods.

On Linux, since you start using LNet, GDB can crash randomly (upon compilations) with diverse kind of reports. Setting debugger to Automatic in both lnetbase and lnetvisual package's options fixes the issue.

Roadmap

Items that are struck through have been completed in the indicated version:

  • Stress testing [always]
  • Addition of Telnet and FTP clients (experimental level) [0.3] (done)
  • Cementing of TCP/UDP API [0.3] (done)
  • Addition of ICMP Ping/Traceroute protocol [na] (cancelled due to various reasons*)
  • Addition of SMTP, HTTP components [0.4] (done)
  • Stabilization of Telnet and FTP clients [0.5] (done)
  • Addition of MIME streams [0.5.1] (done)
  • Addition of Telnet and FTP servers (experimental level) [???]
  • Addition of SSL [0.6+] (done)
  • Addition of Carbon and/or Cocoa widget set support [0.7+]
  • Addition of Qt4 widget set support [0.6.4+] (done)
  • Cleanup of SSL/HTTP (so pure HTTP doesn't depend on TLSSLSocket) [0.6.x?]

* PING requires raw sockets which are only accessible to root on unix/linux platforms. It was decided that lNet won't support this, users who need PING should use the ping and ping6 programs via TProcess.

Requirements

LNet 0.6+:

  • Lazarus 0.9.24+ and FPC 2.2.0+
  • Status: Beta
  • Issues: Completely tested on Windows (WinXP), Linux (Ubuntu 7.10). FastCGI considered broken for now.

LNet 0.5:

  • Lazarus 0.9.22+ and FPC 2.0.4+
  • Status: Beta
  • Issues: Completely tested on Windows (WinXP), Linux (Ubuntu 6.10) and FreeBSD 5.5. FastCGI considered broken for now. WinCE requires Lazarus 0.9.23+ to compile!

LNet 0.4:

  • Lazarus 0.9.18+ and FPC 2.0.4+
  • Status: Beta
  • Issues: Completely tested on Windows (WinXP), Linux (Ubuntu 6.06LTS) and FreeBSD 6.1. HTTP server has issues under high load with fastcgi usage. FastCGI works only in Linux for now.

Ubuntu special notice

Some "missing files" are, in fact, in the "/net" subfolder and are not found by the fpc compiler. Simply copy missing files from the subfolder (lnet.pas, tomwinsock.pas, lfunc.inc...) "/usr/lib/lazarus/components/lnetpackage/lnet" in the "/usr/lib/lazarus/components/lnetpackage" folder (adjust paths as necessary). Then complete the setup by following the installation procedure. (by Steph12358)

API changes

0.1 to 0.2

  • There have been some API changes from 0.1 to 0.2. These were required and should improve the usability of packages. I know API changes are always a PITA but I'll try to keep them minimal from now on. Version 0.3 will be the first beta from which API will remain unchanged (only adding new stuff will be possible).
  • OnRecieve() changed to OnReceive()
  • Accept() changed to Listen()
  • All events' arguments changed. SocketNumber (int) got changed into aSocket(TLSocket) because of logical and speed reasons

0.2 to 0.3

  • Added OnCanSend and OnConnect. Connect is now non-blocking.
  • Removed buffersize and maxmsgs. Buffersize is no longer required because no internal buffer is used.

0.3 to 0.4

  • Lots of additions. Only "breakage" is that TLSocket.Port got changed into TLSocket.LocalPort and TLSocket.PeerPort for consistency reasons.

0.4 to 0.5

  • We did some API cleanup which resulted in API breakage.
  • All "connection" classes now descend from TLComponent
  • TLSocket now has a .Creator which is a TLComponent property specifying the creator (eg: TLTcp), so you can see now which socket in an event belongs to which connection.
  • Added "Connect()" and "Listen()" parameterless calls to all connections. This is mostly to enable Lazarus visual style, so people can use .Host and .Port properties and repeatedly just call ".Connect()" for example.
  • Added "StatusSet" set to SMTP and FTP components. This enables you to monitor specific FTP or SMTP actions and their results with events OnSuccess and OnFailure. You set the events to be watched in the set, and get results in one of the callbacks.
  • Changed ALL callbacks which didn't use TLSocket as sender to use it. This means all FTP, SMTP and HTTP events which had "Sender: TL<HigherType>" were reverted to basic Socket style callbacks!

0.5.4- to 0.5.5+

  • Some minor API changes were made which shouldn't break anything but I list them to be on the safe side.
  • .Timeout property on eventers and connections was set to Integer (from DWord) to support -1 as "block until an event happens"

0.5 to 0.6

  • No changes in public API, only additions.

Note for 0.4.0: In version 0.4.0, I forgot to move lHTTPSettings unit from lib to the http example. It was NOT supposed to be a part of the library, just the example. DON'T use this, it's not a "library", it's a part of the example (http server will get it's own project later)

lNet for FreeBSD, Linux, macOS and Windows

  • lNet for FreeBSD, Linux, macOS and Windows
    • Many changes so that the library will now compile on the above with FPC 3.2.2 or FPC 3.3.1.
    • TLSv1.3 added
    • Linux TLS is not working due to an epoll problem in the file lib/sys/lepolleventer.inc
    • The console examples compile (I have tested the SMTP example which was what I was after).
    • The visual component examples do not compile for macOS - there are no Cocoa, or even defunct Carbon, interface bindings.

See also