From 23757781c3e613f2cf5e05a518f4e0c1d2ec146e Mon Sep 17 00:00:00 2001 From: LDDestroier Date: Sat, 28 Nov 2020 01:21:00 -0500 Subject: [PATCH] Create disknet.md --- disknet.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 disknet.md diff --git a/disknet.md b/disknet.md new file mode 100644 index 0000000..949c405 --- /dev/null +++ b/disknet.md @@ -0,0 +1,22 @@ +# Disknet +Disknet works by using a shared directory between two or more computers to emulate the functionality of a modem. A channel file is opened, which can be used to send/receive messages to/from it. +While one machine is receiving, it is constantly checking the channel file for changes. If it finds one, it will re-read it and see if a new message was sent. + +## Functions: +`disknet.open(string channelName)` +Opens a channel for use. Unopened channels can't be used. + +`disknet.close(string channelName)` +Closes a channel. + +`disknet.closeAll()` +Closes all channels. + +`disknet.isOpen(string channel)` +Returns true/false is a channel is already open. + +`disknet.send(string channel, string message, optional number recipientID)` +Sends `message` on `channel`. If a `recipientID` is specified, then only a disknet recipient whose computer ID matches it will be able to receive the message. + +`disknet.receive(optional string channel, optional number senderID)` +Receives a disknet message. If `channel` is specified, it will only accept messages from that channel. If `senderID` is specified, it will only accept messages from that sender computer ID.