Create disknet.md

This commit is contained in:
LDDestroier 2020-11-28 01:21:00 -05:00 committed by GitHub
parent b52041d20f
commit 23757781c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 0 deletions

22
disknet.md Normal file
View File

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