2 -- TLS Sockets contain the underlying socket and context in the fields
3 -- "socket" and "context".
5 module "nixio.TLSSocket"
7 --- Initiate the TLS handshake as client with the server.
9 -- @name TLSSocket.connect
10 -- @usage This function calls SSL_connect().
11 -- @usage You have to call either connect or accept before transmitting data.
12 -- @see TLSSocket.accept
15 --- Wait for a TLS handshake from a client.
17 -- @name TLSSocket.accept
18 -- @usage This function calls SSL_accept().
19 -- @usage You have to call either connect or accept before transmitting data.
20 -- @see TLSSocket.connect
23 --- Send a message to the socket.
25 -- @name TLSSocket.send
26 -- @usage This function calls SSL_write().
27 -- @usage <strong>Warning:</strong> It is not guaranteed that all data
28 -- in the buffer is written at once.
29 -- You have to check the return value - the number of bytes actually written -
30 -- or use the safe IO functions in the high-level IO utility module.
31 -- @usage Unlike standard Lua indexing the lowest offset and default is 0.
32 -- @param buffer Buffer holding the data to be written.
33 -- @param offset Offset to start reading the buffer from. (optional)
34 -- @param length Length of chunk to read from the buffer. (optional)
35 -- @return number of bytes written
37 --- Send a message on the socket (This is an alias for send).
38 -- See the send description for a detailed description.
40 -- @name TLSSocket.write
41 -- @param buffer Buffer holding the data to be written.
42 -- @param offset Offset to start reading the buffer from. (optional)
43 -- @param length Length of chunk to read from the buffer. (optional)
44 -- @see TLSSocket.send
45 -- @return number of bytes written
47 --- Receive a message on the socket.
49 -- @name TLSSocket.recv
50 -- @usage This function calls SSL_read().
51 -- @usage <strong>Warning:</strong> It is not guaranteed that all requested data
53 -- You have to check the return value - the length of the buffer actually read -
54 -- or use the safe IO functions in the high-level IO utility module.
55 -- @usage The length of the return buffer is limited by the (compile time)
56 -- nixio buffersize which is <em>nixio.const.buffersize</em> (8192 by default).
57 -- Any read request greater than that will be safely truncated to this value.
58 -- @param length Amount of data to read (in Bytes).
59 -- @return buffer containing data successfully read
61 --- Receive a message on the socket (This is an alias for recv).
62 -- See the recv description for more details.
64 -- @name TLSSocket.read
65 -- @param length Amount of data to read (in Bytes).
66 -- @see TLSSocket.recv
67 -- @return buffer containing data successfully read
69 --- Shut down the TLS connection.
71 -- @name TLSSocket.shutdown
72 -- @usage This function calls SSL_shutdown().