This enet fork changes what the upstream would not
⚡️ ENet reliable UDP networking library
At a glance
- What is it?
- zpl-c/enet is a C library that provides a relatively thin, simple and robust communication layer on top of UDP, with optional reliable in-order delivery and fragmentation, distributed as a single header you drop into a project. It is a fork of the original ENet by Lee Salzman, and the fork exists to make the changes the upstream would not accept, including integrated IPv6 support, monotonic time, a project-wide code style pass, the single-header layout and the removal of older and outdated methods.
- Who is it for?
- This enet fork is the right choice if you want ENet's model of reliable UDP in a form you can vendor as one header, or if you need the IPv6 and monotonic clock changes that the upstream does not carry. It is the wrong choice if you want the battle-tested original, because the fork's own disclaimer says the original offers a stable, time-tested library and that this one is trying to change things, and the removed older methods are a compatibility risk for an existing codebase.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 129 days ago.
- What is it written in?
- Mainly C, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.
Editorial analysis
What the fork changed, and why it exists
The disclaimer comes before the description, and it is the most important paragraph in the repository. This is a fork of the original library, lsalzman/enet, and while the original offers a stable, time-tested library, the fork is trying to change some things which cannot be reflected on the main repository. The list is explicit: integrated IPv6 support, added monotonic time, an applied project-wide code style change, a cleaned up project, single-header style code, the removal of some older or outdated methods, and many other various changes. That last clause is the one to read carefully, because the removal of methods is a breaking change rather than a feature, and a project that maintains a fork of a widely vendored library is making a trade between compatibility and cleanliness. The original authors are credited, with @lsalzman, @inlife, @zpl-zak and @nxrighthere named as the bringers of this fork.
Reliable delivery over UDP, and everything it refuses to do
The description says the purpose of ENet is to provide a relatively thin, simple and robust network communication layer on top of UDP (User Datagram Protocol). The primary feature it provides is optional reliable, in-order delivery of packets, and fragmentation. The omissions are as important as the features, because the library deliberately leaves out higher level networking features such as authentication, lobbying, server discovery, encryption, or other similar tasks that are particularly application specific, so that the library remains flexible, portable and easily embeddable. That is a real architectural position, and it has a consequence in a project: you get a transport that can tell you a packet arrived and will not tell you who is on the other end, and if your game needs a lobby you are writing that yourself in the layer above.
The single header is the preferred distribution
The installation is one download. The file enet.h is fetched from the latest release and added to your project, and the usage section labels the single header approach as preferred, in which case the library is embedded in the project itself. The mechanism is one define, and the rule is that you add a define for ENET_IMPLEMENTATION exactly in one source file before including the enet.h. Everywhere else in the project you include the header without it and get the declarations. That pattern is the usual way a single-header C library is distributed, and it is worth understanding why it is preferred here, because the fork's cleanup and the removal of older methods both make the header larger and the implementation more self-contained, which is what makes the one-file distribution work. The repository root has an include/ directory with the header and a misc/ directory with the packager that produces it.
Building the shared and static libraries with CMake
The other two usage modes are ordinary CMake builds, and they differ by a flag. For the shared library you configure with the shared option and a release build type:
$ cmake -B build -DENET_SHARED=1 -DCMAKE_BUILD_TYPE=Release
$ cmake --build buildand for the static library the same with the static flag:
$ cmake -B build -DENET_STATIC=1 -DCMAKE_BUILD_TYPE=Release
$ cmake --build buildThe shared build needs one line of extra care in the consuming code, which is the ENET_DLL define before the include, so that the import and export decorations are right:
#define ENET_DLL
#include <enet.h>
#include <stdio.h>The static and shared examples are otherwise identical in shape, and the important detail in both is the pair of calls at the start and the end, enet_initialize() and enet_deinitialize(), because ENet keeps global state and the initialisation returns non-zero on failure.
The event loop is the API, and the demo shows all of it
The server and client demos are the clearest documentation of how the library is meant to be driven, and they are in the README in full. The server creates a host bound to ENET_HOST_ANY on port 7777 with a maximum of 32 clients and two channels, then sits in a loop calling enet_host_service(server, &event, 1000) and switching on the event type. The types are ENET_EVENT_TYPE_CONNECT, ENET_EVENT_TYPE_RECEIVE, ENET_EVENT_TYPE_DISCONNECT, ENET_EVENT_TYPE_DISCONNECT_TIMEOUT and ENET_EVENT_TYPE_NONE, and the receive case is where the packet is used and then destroyed with enet_packet_destroy, which is the memory management rule a user has to respect. The disconnect timeout case is the one worth noticing, because it is how a peer that stopped answering is reaped rather than waited on forever. The client side is the mirror, with enet_host_connect and a channel count of two.
The release is a package.json script, and the header is the asset
The build and release machinery sits in an unexpected place, a package.json in a C library, and it explains how the single header is produced. The package is named enet.c at version 2.7.0 with the MIT licence, the main field points at include/enet.h, and the documentation directory is misc/docs. The embed script runs the packager to embed the includes, and there is a family of release scripts built on release-it, for patch, minor and major, and pre-release variants of each that pass a preRelease flag, all with the ci flag. The release-it configuration disables npm publishing and enables GitHub releases, and the asset it publishes is misc/deploy/enet.h, so the file a user downloads from the releases page is generated rather than the one in include/. The only dev dependency is release-it itself.
Fork or upstream, and what you lose either way
The honest comparison is with the original. The upstream is described by the fork's own disclaimer as stable and time-tested, and it is the choice for a project that wants the established behaviour with a long history of fixes. The fork is the choice for a project that wants the single header, the IPv6 support, the monotonic clock, and a codebase that has been brought up to a current style, and that accepts the removed methods as the cost. Neither is a general networking library, because both omit encryption and authentication, so a project shipping ENet over a real network has to add a layer it does not get here. The fork's own history is the argument to read before committing, with v2.6.4 and v2.6.5 in June 2025 and v2.7.0 in June 2026, and the last push on the same day as that release, so the cadence is a release every few months rather than a trickle.
Editorial conclusion
This enet fork is the right choice if you want ENet's model of reliable UDP in a form you can vendor as one header, or if you need the IPv6 and monotonic clock changes that the upstream does not carry. It is the wrong choice if you want the battle-tested original, because the fork's own disclaimer says the original offers a stable, time-tested library and that this one is trying to change things, and the removed older methods are a compatibility risk for an existing codebase. Before you adopt the fork, read the disclaimer and diff it against the upstream you know, and check the release history, since the published versions move when the fork does, and decide whether the single-header distribution suits a project with a package manager of its own.
Frequently asked questions
What is the difference between zpl-c/enet and the original ENet?
It is a fork of lsalzman/enet that makes changes the upstream would not take, including integrated IPv6 support, added monotonic time, a project-wide code style change, a cleaned up project, single-header style code, the removal of some older or outdated methods, and other changes. The fork's own disclaimer notes the original offers a stable, time-tested library.
How do I use enet as a single header?
Download enet.h from the latest release and add it to your project. Define ENET_IMPLEMENTATION in exactly one source file before including the header, and include it without that define everywhere else. The README labels the single header usage as preferred, with the library embedded in the project itself.
How do I build the shared or static library?
With CMake, configuring with -DENET_SHARED=1 for the shared library or -DENET_STATIC=1 for the static one, plus -DCMAKE_BUILD_TYPE=Release, then building with cmake --build build. A consumer of the shared library defines ENET_DLL before including the header.
What does ENet deliberately not implement?
It omits higher level networking features such as authentication, lobbying, server discovery, encryption and similar application specific tasks, so that the library stays flexible, portable and easily embeddable. Its purpose is to provide optional reliable, in-order delivery of packets and fragmentation on top of UDP.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/zpl-c-enet)Was this useful?