From af3047fb565ab7848e76fca37c8958b837be2374 Mon Sep 17 00:00:00 2001 From: Guillaume ARM Date: Sun, 17 Jul 2022 20:15:52 +0200 Subject: [PATCH] chore: add aliases in net api + update doc --- README.md | 4 ++-- apis/net.lua | 4 ++++ ping.lua | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 32d0419..9249fe2 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,8 @@ wget run https://raw.githubusercontent.com/guillaumearm/cc-libs/master/install.l - `apis/net`: api to simplify sending and receiving routed messages (based on eventloop library) ## Servers -- `router`: route messages (you need to setup a router to be able to use `apis/net`) -- `ping-server`: is automatically started on boot (use `apis/net`) +- `router`: route messages (you need to setup a router to be able to use all `apis/net` based programs and libs) +- `servers/ping-server`: is automatically started on boot (use `apis/net`) ## Programs - `ping` : ping machines (use `apis/net`) \ No newline at end of file diff --git a/apis/net.lua b/apis/net.lua index 5e08267..72b2f00 100644 --- a/apis/net.lua +++ b/apis/net.lua @@ -241,9 +241,13 @@ local function createNetwork(el, modem, routingChannel, timeoutInSec) createEvent = createEvent, isPacketOk = isPacketOk, openChannel = openChannel, + open = openChannel, events = el, + eventloop = el, start = start, + startLoop = start, stop = stop, + stopLoop = stop, } end diff --git a/ping.lua b/ping.lua index 96efd94..6a3acc4 100644 --- a/ping.lua +++ b/ping.lua @@ -1,7 +1,7 @@ -- ping v2.0.0 local PING_CHANNEL = 9; -local createNet = require('apis/net'); +local createNet = require('/apis/net'); local net = createNet(); local args = table.pack(...);