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.
Building evaluation applications
In previous versions of 4D, developers could request evaluation licenses for development purposes, but providing end users with evaluation versions of built applications—whether standalone or client/server—was challenging or even impossible.
Starting with 4D 20.7 and 20 R8, you can now create evaluation versions of your applications. When a user runs an evaluation application for the first time on a new machine, it will automatically contact a 4D service to obtain a 14-day evaluation license—without any manual action required from the user.
This blog post will guide you through the process of creating an evaluation version of your application for demo purposes.
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.
Notarization on macOS: Changes to Component Structure
The macOS notarization process continues to evolve. Unfortunately, the internal structure of 4D components designed with 4D v11—intended to enable cross-platform compatibility—no longer meets the requirements introduced by Apple for Silicon-based Macs, making notarizing components increasingly challenging.
To simplify the deployment process, we have updated the component structure starting with 4D 20 R8. This new folder structure makes notarization and deployment as straightforward as deploying an application. However, there is an important caveat: the updated structure is not compatible with older versions of 4D (e.g., 4D 20 R7 and earlier), while older components will remain compatible with newer versions of 4D.
The Build4D component has also been updated to reflect the new structure. When building components, be cautious and ensure you are using the correct version of Build4D.
Important Reminder: Components built with 4D 20 R7 or earlier may encounter errors during notarization. The recommended solution is to update to 4D 20 R8.
Encryption. Authentication. & Certificate Authority Validation
In recent releases, 4D’s security capabilities have been significantly expanded, particularly in the area of certificates. This includes auto-generated certificates for client-server communication, support for ECDSA certificates, and, with 4D 20 R7, the validation of certificate authority for client-server communication of engined applications. Some customers require the highest level of security, highlighting the importance of these features.
However, security can be complex, and there have been requests for an explanation of how a TLS/SSL connection works and the role of certificates. Therefore, before delving into the new features, it’s helpful to first break down the basic security concepts and their interactions.
Introducing Session Singletons
Singletons have been one of the standout features of 4D 20 R5. Previously, developers could leverage two types of singletons:
- the process singleton, which is unique to each process but different across processes,
- and the shared singleton, which is unique across the whole application.
With 4D 20 R7, we are releasing a new type of singleton: the session singleton!
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.
REST and Qodly Support of Singletons
With 4D 20 R5, we released singletons. And with 4D 20 R6, we now allow you to directly call the exposed functions of your shared singletons through REST calls. Similarly, you can use the exposed functions of your shared singletons in events when designing your Qodly Pages. Let me delve deeper into these new capabilities.
Managing HTTP Requests with HTTP Agents
In 4D 19 R6, we introduced HTTP classes to modernize syntax and enhance functionalities for our HTTP client commands. Building on this foundation, 4D 20 R6 brings a powerful new feature: HTTP agents. These agents empower developers to customize and optimize their connections to HTTP servers by managing connection persistence and reuse for HTTP requests.
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.
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