From 3b6e505f0d5ac7133ac379a5be36e19479604a54 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Tue, 3 Jul 2018 20:23:01 -0600 Subject: Started working on documentation Useing ldoc --- doc/index.html | 423 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 423 insertions(+) create mode 100644 doc/index.html (limited to 'doc/index.html') diff --git a/doc/index.html b/doc/index.html new file mode 100644 index 0000000..517b2c9 --- /dev/null +++ b/doc/index.html @@ -0,0 +1,423 @@ + + + + + Reference + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Module net

+

The net library +Exposes various structs, constants, and functions for passing messages

+

+ + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
stream:readint ()Read an integer from the stream
stream:readdouble ()Read double percision float from the stream
stream:readdata (size)Read some data from the stream
stream:readstring ()Read a string from the stream
stream:writeint (i)Write an integer to the stream
stream:writedouble (d)Write a double percision float to the stream
stream:writedata (d)Write some data to the stream
stream:writestring (s)Write a string to the stream
socket:bind (where)
receive (message, callback)
newsocket ()
+

Tables

+ + + + + +
socket
+ +
+
+ + +

Functions

+ +
+
+ + stream:readint () +
+
+ Read an integer from the stream + + + + +

Returns:

+
    + + number + The number read from the stream +
+ + + + +
+
+ + stream:readdouble () +
+
+ Read double percision float from the stream + + + + +

Returns:

+
    + + number + The number read from the stream +
+ + + + +
+
+ + stream:readdata (size) +
+
+ Read some data from the stream + + + +

Parameters:

+
    +
  • size + number + The size of the data to read from the stream +
  • +
+ +

Returns:

+
    + + string + The data read from the stream +
+ + + + +
+
+ + stream:readstring () +
+
+ Read a string from the stream + + + + +

Returns:

+
    + + string + The string read from the stream +
+ + + + +
+
+ + stream:writeint (i) +
+
+ Write an integer to the stream + + + +

Parameters:

+
    +
  • i + number + The integer to write to the stream +
  • +
+ + + + + +
+
+ + stream:writedouble (d) +
+
+ Write a double percision float to the stream + + + +

Parameters:

+
    +
  • d + number + The number to write to the stream +
  • +
+ + + + + +
+
+ + stream:writedata (d) +
+
+ Write some data to the stream + + + +

Parameters:

+
    +
  • d + number + The number to write to the stream +
  • +
+ +

Returns:

+
    + + number + The number of bytes written to the stream +
+ + + + +
+
+ + stream:writestring (s) +
+
+ Write a string to the stream + + + +

Parameters:

+
    +
  • s + string + The string to the stream +
  • +
+ + + + + +
+
+ + socket:bind (where) +
+
+ + + + +

Parameters:

+
    +
  • where + string + Where to connect this socket to +
  • +
+ + + + +

Usage:

+
    +
    local s = net.newsocket()
    +s:bind("127.0.0.1")
    +s:receive("ping",function(stream)
    +	print(instream:readstring())
    +end)
    +local c = net.newsocket()
    +c:connect("127.0.0.1")
    +
+ +
+
+ + receive (message, callback) +
+
+ + + + +

Parameters:

+
    +
  • message + string + The message to bind this function to +
  • +
  • callback + function + The function to call when this message is received +
  • +
+ + + + + +
+
+ + newsocket () +
+
+ + +

domain:

+
    + shared +
+ + +

Returns:

+
    + + net.socket +
+ + + + +
+
+

Tables

+ +
+
+ + socket +
+
+ + +

domain:

+
    + shared +
+ +

Fields:

+
    +
  • fd + +
  • +
+ + + + + +
+
+ + +
+
+
+generated by LDoc 1.4.6 +Last updated 2018-07-03 16:38:22 +
+
+ + -- cgit v1.2.3-70-g09d2