Giter Club home page Giter Club logo

enet-example's Introduction

enet, sokol, nuklear, pthreads example

This is an example program using:

If you find any issues or would like to see something implemented (something small), make an issue. I would like for this to be useful to someone, so if it can be better, that would be great :)

Building

This was only built on linux, no idea if it works on other platforms. You will need the meson build system, and some backend for meson (probably ninja).

Dependencies

pthreads is the only thing you might(?) need to install. enet, sokol, and nuklear are included in the 'libs' folder.

Build

meson build
ninja -C build

The binary 'enet_test' will be in the build directory

Running

There will be 4 windows when you run the program, the server window and 3 clients. Launch the server with the 'launch' button. Client 0 is always available (it runs on the main thread). Clients 1 and 2 have to be launched (similar to the server), as they run on their own threads. Clients can connect or disconnect to the server with the given buttons.

In the server window, the 'send packet to all clients' will send a packet to all of the clients connected to the server. Below each listed client in the server window, the 'send packet' button will send a packet to that individual client.

In the client windows, 'send packet' will send a packet to the server. 'send packet to all' sends a packet to the server, which triggers the server to send a packet to all connected clients.

Notices about sent and received packets, as well as launched/shutting down servers/clients, are printed on the console.

To exit, press ESC or close the window.

Licenses

The code in this repository is licensed under CC0.

Licenses for the included libraries are in their respective folders in libs.

enet-example's People

Contributors

ddexxedd avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.