|
enum | ConnectionError {
ERROR_NONE = 0,
ERROR_GENERIC = -1,
CONNECTION_ERROR_WANTS_READ = -2,
CONNECTION_ERROR_WANTS_WRITE = -3,
SSL_PEER_CLOSE_NOTIFY = -4,
MEMORY_ALLOCATION_FAILED = -5,
SSL_CONNECTION_ERROR = -6,
SOCKET_READ_ERROR = -7,
SOCKET_SEND_ERROR = -8,
SOCKET_ABORT = -9,
DNS_RESOLVING_ERROR = -10,
SSL_HANDSHAKE_ERROR = -11,
FAILED_TO_READ_CREDENTIALS = -12
} |
|
|
class | Test_M2MConnectionHandler |
|
class | Test_M2MConnectionHandler_mbed |
|
class | Test_M2MConnectionHandler_linux |
|
class | M2MConnection_TestObserver |
|
This enum defines an error that can come from the socket read and write operation.
bool M2MConnectionHandler::bind_connection |
( |
const uint16_t |
listen_port | ) |
|
This binds the socket connection.
- Parameters
-
listen_port | The port to be listened to for an incoming connection. |
- Returns
- True if successful, else false.
void M2MConnectionHandler::force_close |
( |
| ) |
|
Closes the open connection.
- Note
- This must be called from the same event loop context!
void M2MConnectionHandler::handle_connection_error |
( |
int |
error | ) |
|
Error handling for DTLS connectivity.
- Parameters
-
error | An error code from the TLS library. |
This resolves the server address. The output is returned through a callback.
- Parameters
-
String | The server address. |
uint16_t | The server port. |
ServerType | The server type to be resolved. |
security | The M2MSecurity object that determines which type of secure connection is used by the socket. |
- Returns
- True if the address is valid, else false.
bool M2MConnectionHandler::send_data |
( |
uint8_t * |
data_ptr, |
|
|
uint16_t |
data_len, |
|
|
sn_nsdl_addr_s * |
address_ptr |
|
) |
| |
Sends data to the connected server.
- Parameters
-
data_ptr | The data to be sent. |
data_len | The length of data to be sent. |
address_ptr | The address structure to which the data needs to be sent. |
- Returns
- True if data is sent successfully, else false.
void M2MConnectionHandler::set_platform_network_handler |
( |
void * |
handler = NULL | ) |
|
Sets the network interface handler that is used by the client to connect to a network over IP.
- Parameters
-
handler | A network interface handler that is used by the client to connect. This API is optional but it provides a mechanism for different platforms to manage the usage of underlying network interface by client. |
bool M2MConnectionHandler::start_listening_for_data |
( |
| ) |
|
Listens to the incoming data from a remote server.
- Returns
- True if successful, else false.
The documentation for this class was generated from the following file: