chore: add aliases in net api + update doc

This commit is contained in:
Guillaume ARM 2022-07-17 20:15:52 +02:00
parent 280a28777c
commit af3047fb56
3 changed files with 7 additions and 3 deletions

View File

@ -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`)

View File

@ -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

View File

@ -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(...);