From f5a95e387baeb50815525dbcab86e750570e3b1d Mon Sep 17 00:00:00 2001 From: CokaCola Date: Mon, 10 Mar 2014 08:28:01 -0700 Subject: [PATCH] Updated API Internet (markdown) --- API-Internet.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/API-Internet.md b/API-Internet.md index 6ddb14f..556f4f6 100644 --- a/API-Internet.md +++ b/API-Internet.md @@ -14,15 +14,15 @@ This library wraps functionality of Internet cards. - `internet.connect(address:string[, port:number]):number` Opens a new TCP connection. Returns the handle of the connection. The returned handle can be used to interact with the opened socket using the other callbacks. This can error if TCP sockets are not enabled, there are too many open connections or some other I/O error occurs. - `internet.read(handle:number,n:number):string` - Tries to read data from the socket stream. Returns the read byte array. + Tries to read data from the socket stream. Returns the read byte array. Takes the handle returned from internet.connect - `internet.write(handle:number, data:string): number` - Tries to write data to the socket stream. Returns the number of bytes written. + Tries to write data to the socket stream. Returns the number of bytes written. Takes the handle returned by internet.connect - `internet.close(handle:number)` Closes the socket with the specified handle. Note for internet.open, you may also do this: ```lua -local handle = internet.open(...) +local handle = internet.connect(...) data = handle:read(10) handle:write("1234") handle:close()