Work and Move with QUIC and Network Switching
What’s more frustrating than losing your 4D Remote connection to the 4D Server while switching networks on the go?
Whether you’re moving from Ethernet to Wi-Fi or hopping between hotspots, traditional connections tend to drop, forcing 4D Remote to disconnect and reconnect.
With 4D 21 and the QUIC protocol, those interruptions are a thing of the past.
QUIC is designed to be resilient during network changes, keeping your session alive even when the underlying connection shifts.
New Class to Perform UDP Communications
4D 20 R8 introduced the TCPConnection class, bringing an object-oriented, asynchronous way to handle TCP client connections. Then came 4D 20 R9 with the TCPListener class to build TCP servers. And now, with 4D 20 R10, we’re completing the picture with the new UDPSocket class, allowing you to manage UDP communications between 4D and any remote machine, both as a client and a server. This is especially useful for IoT, real-time monitoring, or broadcasting exchanges. And the icing on the cake? This class supports preemptive and asynchronous UDP communication
Finally, this new feature is marking the final step in replacing the legacy Internet Commands plugin.
Let’s dive into the details.
New class to handle incoming TCP connections
In 4D 20 R8, we introduced the TCPConnection class, allowing you to initiate TCP connections to remote servers. With 4D v20 R9, we’re excited to bring you the TCPListener class—your key to handling incoming TCP connections and building a TCP server directly in 4D.
With these two classes—TCPConnection and TCPListener—you now have full control over TCP communication, both client- and server-side.
Let’s walk through how to use them together.
New class to perform TCP connections
With the release of 4D 20 R8, a game-changing feature has arrived:: the TCPConnection class. This modern class leverages object-oriented syntax and supports asynchronous network connection handling, providing a fresh and powerful alternative to the 4D Internet Commands. Using TCPConnection, you can connect to virtually anything—whether it’s servers, printers, cash registers, or industrial devices—making it a versatile tool for handling unique networking requirements.
In this release, the TCP client functionality is available, allowing you to connect to external servers and seamlessly exchange data.
QUIC Network Layer is Production Ready!
With the beta of 4D 20, we introduced you to our new network layer: The QUIC network layer.
At that time, it was still in development and thus removed from the official release. Today, we’re thrilled to announce that the QUIC network layer is out of beta and officially ready for production!
After rigorous load testing and valuable feedback from early adopters, QUIC’s stability and performance have been validated—surpassing even ServerNet in key areas. Now that QUIC has reached feature parity with ServerNet in 4D 20 R5, it’s the perfect time to consider making the switch.
But first, let me tell you more about such great news.
Deprecation of the Legacy Network Layer
To handle the communication between 4D Client and 4D Server, 4D proposes 3 different network layers:
- Legacy,
- ServerNet,
- and QUIC.
The Legacy network layer was introduced 30 years ago in 4D v3. It was originally developed for AppleTalk, enhanced for ISDN, and then added IPX and finally TCP/IP.
It was created for a very different Client/Server usage than 4D works today: it is single-threaded, optimized for slow networks with no encryption, and available for many different network protocols. As such, it is not optimized at all for modern network communications and supports a very limited number of features.
That’s why, with 4D 20 R5, we have decided to make the Legacy network layer obsolete and plan to remove it soon. We encourage you to move to ServerNet now if you are still using it. Let me explain what benefits you will get from the switch.
QUIC Now Matches ServerNet Capabilities
The QUIC network layer now supports as many features as the ServerNet network layer. With 4D 20 R5, we added support for IPv6, broadcast, and Single Sign-on on Windows.
Of course, we will continue to improve it in the coming versions to make it the best network layer 4D has ever had.
But for now, let me speak a bit more about the last functionalities we added.
New 4D remote session object with Client/Server connection and Stored procedure
In 4D applications, four types of sessions exist 4D Remote session, Stored Procedure session, Mobile session, and Web session.
The Session command already returns Web or Mobile sessions. This gives you access to a wealth of information about the session and an object shared by all processes in the session.
In 4D 20 R5, the Session command has been extended to the Client/Server connection and stored procedure.
QUIC network layer: Automatic update and sleep mode
Our development of the QUIC network layer continues, and with 4D 20 R4, we now have the sleep mode and the automatic update. Let’s take a closer look at these enhancements and see how they compare to the way they work with other network layers.
Activate QUIC Layer from the Structure, User and Database Settings
In 4D v20 beta, we were excited to show you our work on the new QUIC network layer. As the layer is still in the beta version, we deactivated it for the LTS final release. The QUIC layer will be available in the feature releases, so you can follow its development and help us improve it.
While 4D v20 allowed switching network layers only in interpreted applications and forced a new build for engined applications, 4D v20 R2 allows layer changing in compiled/build applications via the Structure, User and Database Settings to facilitate testing even in production.
Contact us
Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!
* Your privacy is very important to us. Please click here to view our Policy
