Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
E

enet

> 编程语言
Open source

⚡️ ENet reliable UDP networking library

1.1K stars0 likes1 views
WebsiteGitHub

About

⚡️ ENet reliable UDP networking library

Disclaimer

This is a fork of the original library lsalzman/enet. While original repo offers a stable, time-tested wonderful library, we are trying to change some things, things, which can't be reflected on the main repo, like:

  • integrated ipv6 support
  • added monotonic time
  • applied project-wide code style change
  • cleaned up project
  • single-header style code
  • removed some of older/outdated methods
  • and many other various changes

Description

ENet's purpose 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.

ENet omits certain 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.

Installation

Download file releases/latest/enet.h and just add to your project.

Usage (Shared library)

Build the shared library:

bash
$ cmake -B build -DENET_SHARED=1 -DCMAKE_BUILD_TYPE=Release
$ cmake --build build

Use it:

c
#define ENET_DLL
#include 
#include 

int main() {
    if (enet_initialize () != 0) {
        printf("An error occurred while initializing ENet.\n");
        return 1;
    }

    enet_deinitialize();
    return 0;
}

Usage (Static library)

Build the static library:

bash
$ cmake -B build -DENET_STATIC=1 -DCMAKE_BUILD_TYPE=Release
$ cmake --build build

Use it:

c
#include 
#include 

int main() {
    if (enet_initialize () != 0) {
        printf("An error occurred while initializing ENet.\n");
        return 1;
    }

    enet_deinitialize();
    return 0;
}

Usage (Single Header, Preferred)

In this case, library will be embedded to the project itself.

Make sure you add a define for ENET_IMPLEMENTATION exactly in one source file before including the enet.h.

Here is a simple server and client demo, it will wait 1 second for events, and then exit if none were found:

Server:

…

Client:

…

Tutorials

More information, examples and tutorials can be found at the official site: http://enet.bespin.org/

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Cccppenetfork

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言