Defines |
#define | IOTCS_RESULT_SSL_WANT_READ IOTCS_RESULT_CANNOT_AUTHORIZE |
Functions |
iotcs_result | iotcs_port_ssl_init (const char *addr, unsigned short port) |
| Initializes ssl related resources.
|
void | iotcs_port_ssl_finalize (void) |
| Finalizes ssl related resources.
|
iotcs_result | iotcs_port_ssl_connect (void) |
| Establishes ssl connection with the server.
|
iotcs_result | iotcs_port_ssl_disconnect (void) |
| Closes connection with the server.
|
iotcs_result | iotcs_port_ssl_write (char *request, size_t length) |
| Sends content to the server host using ssl connection.
|
iotcs_result | iotcs_port_ssl_read (char *buffer, int len, int *bytes_read) |
| Reads all bytes from the ssl connection into the buffer Do blocking read of all the bytes from established connection until given buffer is full or the connection is closed by peer.
|
iotcs_result | iotcs_port_ssl_connect_lp (int32_t timeout_ms) |
| Establishes ssl connection with the server for long polling.
|
iotcs_result | iotcs_port_ssl_disconnect_lp (void) |
| Closes long polling connection with the server.
|
iotcs_result | iotcs_port_ssl_write_lp (char *request, size_t length) |
| Sends content to the server host using long polling ssl connection.
|
iotcs_result | iotcs_port_ssl_read_lp (char *buffer, int len, int *bytes_read) |
| Reads all bytes from the long polling ssl connection into the buffer Do blocking read of all the bytes from established connection until given buffer is full or the connection is closed by peer or the receive timeout (given in iotcs_port_ssl_connect_lp call) has expired.
|
iotcs_result | iotcs_port_storage_ssl_init (const char *addr, unsigned short port, iotcs_bool is_ssl) |
| Initializes ssl related resources.
|
void | iotcs_port_storage_ssl_finalize (void) |
| Finalizes ssl related resources.
|
iotcs_result | iotcs_port_storage_ssl_connect (void) |
| Establishes ssl connection with the storage cloud server.
|
iotcs_result | iotcs_port_storage_ssl_disconnect (void) |
| Closes the connection with the storage cloud server.
|
iotcs_result | iotcs_port_storage_ssl_read (char *buffer, int len, int *bytes_read) |
| Reads all bytes from the storage cloud server ssl connection into the buffer Do blocking read of all the bytes from established connection until given buffer is full or the connection is closed by peer.
|
iotcs_result | iotcs_port_storage_ssl_write (char *request, size_t length) |
| Sends content to the storage cloud server.
|
The file contains porting layer for ssl functionality.
Methods for SSL/TLS protocol Library always calls iotcs_port_ssl_init before start using port SSL API and iotcs_port_ssl_finalize when has stopped using port SSL API.
Port SSL API always shall support at least one SSL connection. Library works with this connection by calling blocking methods iotcs_port_ssl_connect, iotcs_port_ssl_write, iotcs_port_ssl_read, iotcs_port_ssl_disconnect. This is the order in which library calls those methods. The whole connect/write/read/disconnect sequence is invoked from one thread and always exclusively. It means that implementation does not require thread safety.
Library could be built with long polling support by defining IOTCS_LONG_POLLING. Without long polling support library use just one SSL connection at a time. Long polling support adds another connection. Methods that work with this long polling connection have _lp suffix, e.g. iotcs_port_ssl_connect_lp. The whole connect/write/read/disconnect sequence for long polling connection is invoked from one thread and always exclusively. But usual connection and long polling connection could be used by library at same time from different threads.