X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;f=documentation%2Fapi%2Fmodules%2Fnixio.TLSSocket.html;fp=documentation%2Fapi%2Fmodules%2Fnixio.TLSSocket.html;h=36b31f3445da67e654b6a7d27ea52816cb281416;hb=00e2b03927b5c107aefef1c71ef14facd4c3cb77;hp=0000000000000000000000000000000000000000;hpb=ed1a6416964df17b3a76a7043734d0fde4a6bd41;p=project%2Fluci.git diff --git a/documentation/api/modules/nixio.TLSSocket.html b/documentation/api/modules/nixio.TLSSocket.html new file mode 100644 index 000000000..36b31f344 --- /dev/null +++ b/documentation/api/modules/nixio.TLSSocket.html @@ -0,0 +1,543 @@ + + + + Reference + + + + + +
+ +
+ +
+
+
+ +
+ + + +
+ +

Object Instance nixio.TLSSocket

+ +

+ TLS Socket Object. + TLS Sockets contain the underlying socket and context in the fields + "socket" and "context".

+ + + + + + + +

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TLSSocket:accept () + Wait for a TLS handshake from a client.
TLSSocket:connect () + Initiate the TLS handshake as client with the server.
TLSSocket:read  (length) + Receive a message on the socket (This is an alias for recv).
TLSSocket:recv (length) + Receive a message on the socket.
TLSSocket:send (buffer, offset, length) + Send a message to the socket.
TLSSocket:shutdown () + Shut down the TLS connection.
TLSSocket:write (buffer, offset, length) + Send a message on the socket (This is an alias for send).
+ + + + + + +
+
+ + +

Functions

+
+ + + +
TLSSocket:accept ()
+
+ + Wait for a TLS handshake from a client. + + + + + +

Usage

+
    + +
  • This function calls SSL_accept(). + +
  • You have to call either connect or accept before transmitting data. + +
+ + + +

Return value:

+true + + + +

See also:

+ + +
+ + + + +
TLSSocket:connect ()
+
+ + Initiate the TLS handshake as client with the server. + + + + + +

Usage

+
    + +
  • This function calls SSL_connect(). + +
  • You have to call either connect or accept before transmitting data. + +
+ + + +

Return value:

+true + + + +

See also:

+ + +
+ + + + +
TLSSocket:read  (length)
+
+ + Receive a message on the socket (This is an alias for recv). + See the recv description for more details. + + +

Parameters

+
    + +
  • + length: Amount of data to read (in Bytes). +
  • + +
+ + + + + + +

Return value:

+buffer containing data successfully read + + + +

See also:

+ + +
+ + + + +
TLSSocket:recv (length)
+
+ + Receive a message on the socket. + + +

Parameters

+
    + +
  • + length: Amount of data to read (in Bytes). +
  • + +
+ + + + +

Usage

+
    + +
  • This function calls SSL_read(). + +
  • Warning: It is not guaranteed that all requested data + is read at once. + You have to check the return value - the length of the buffer actually read - + or use the safe IO functions in the high-level IO utility module. + +
  • The length of the return buffer is limited by the (compile time) + nixio buffersize which is nixio.const.buffersize (8192 by default). + Any read request greater than that will be safely truncated to this value. + +
+ + + +

Return value:

+buffer containing data successfully read + + + +
+ + + + +
TLSSocket:send (buffer, offset, length)
+
+ + Send a message to the socket. + + +

Parameters

+
    + +
  • + buffer: Buffer holding the data to be written. +
  • + +
  • + offset: Offset to start reading the buffer from. (optional) +
  • + +
  • + length: Length of chunk to read from the buffer. (optional) +
  • + +
+ + + + +

Usage

+
    + +
  • This function calls SSL_write(). + +
  • Warning: It is not guaranteed that all data + in the buffer is written at once. + You have to check the return value - the number of bytes actually written - + or use the safe IO functions in the high-level IO utility module. + +
  • Unlike standard Lua indexing the lowest offset and default is 0. + +
+ + + +

Return value:

+number of bytes written + + + +
+ + + + +
TLSSocket:shutdown ()
+
+ + Shut down the TLS connection. + + + + + +

Usage:

+This function calls SSL_shutdown(). + + + +

Return value:

+true + + + +
+ + + + +
TLSSocket:write (buffer, offset, length)
+
+ + Send a message on the socket (This is an alias for send). + See the send description for a detailed description. + + +

Parameters

+
    + +
  • + buffer: Buffer holding the data to be written. +
  • + +
  • + offset: Offset to start reading the buffer from. (optional) +
  • + +
  • + length: Length of chunk to read from the buffer. (optional) +
  • + +
+ + + + + + +

Return value:

+number of bytes written + + + +

See also:

+ + +
+ + +
+ + + + + +
+ +
+ +
+

Valid XHTML 1.0!

+
+ +
+ +