From ba74d4deed05f31fdf2f9df6250cc3567af8de16 Mon Sep 17 00:00:00 2001 From: CPunch Date: Tue, 12 Jul 2022 16:56:04 -0500 Subject: [PATCH] Created Networking library (markdown) --- Networking-library.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Networking-library.md diff --git a/Networking-library.md b/Networking-library.md new file mode 100644 index 0000000..839c51c --- /dev/null +++ b/Networking-library.md @@ -0,0 +1,13 @@ +Laika has it's own cross-platform networking layer for Windows & Linux environments (it should also work on any POSIX-compliant environment but it hasn't really been tested) + +## Polling + +On Linux, epoll() is used instead of poll() to poll for socket events. The logic for all of this is in `lib/src/lpolllist.c`. + +## Socket abstraction + +A thin wrapper library for basic socket operations exists in `lib/src/lsocket.c`. This handles common things like binding, connecting, sending, receiving & accepting connections for both Windows & Linux environments. + +## Lightweight encrypted packet protocol + +Laika uses a simple keypair based packet encryption technique with LibSodium handling the cryptographic work. For details on how packets are handled, check `lib/src/lpeer.c`. For details on each packet type and it's expected content, see `lib/include/lpacket.h`. \ No newline at end of file