examples/dtls-echo: fix silent fail with ECC
This commit is contained in:
parent
cc6c5a8c7b
commit
1980b94728
@ -43,9 +43,9 @@
|
|||||||
|
|
||||||
/* Delay to give time to the remote peer to do the compute (client only). */
|
/* Delay to give time to the remote peer to do the compute (client only). */
|
||||||
#ifdef CONFIG_DTLS_ECC
|
#ifdef CONFIG_DTLS_ECC
|
||||||
#define DEFAULT_US_DELAY 10000000
|
#define DEFAULT_US_DELAY (20 * US_PER_SEC)
|
||||||
#else
|
#else
|
||||||
#define DEFAULT_US_DELAY 100
|
#define DEFAULT_US_DELAY (1 * US_PER_SEC)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int dtls_connected = 0; /* This is handled by Tinydtls callbacks */
|
static int dtls_connected = 0; /* This is handled by Tinydtls callbacks */
|
||||||
@ -108,7 +108,7 @@ static int dtls_handle_read(dtls_context_t *ctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ssize_t res = sock_udp_recv(sock, packet_rcvd, sizeof(packet_rcvd),
|
ssize_t res = sock_udp_recv(sock, packet_rcvd, sizeof(packet_rcvd),
|
||||||
1 * US_PER_SEC + DEFAULT_US_DELAY, &remote);
|
DEFAULT_US_DELAY, &remote);
|
||||||
|
|
||||||
if (res <= 0) {
|
if (res <= 0) {
|
||||||
if ((ENABLE_DEBUG) && (res != -EAGAIN) && (res != -ETIMEDOUT)) {
|
if ((ENABLE_DEBUG) && (res != -EAGAIN) && (res != -ETIMEDOUT)) {
|
||||||
@ -455,6 +455,11 @@ static void client_send(char *addr_str, char *data)
|
|||||||
watch--;
|
watch--;
|
||||||
} /* END while */
|
} /* END while */
|
||||||
|
|
||||||
|
/* check if we failed to send */
|
||||||
|
if ((app_data_buf != 0)) {
|
||||||
|
printf("Failed to send the data\n");
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* BUG: tinyDTLS (<= 0.8.6)
|
* BUG: tinyDTLS (<= 0.8.6)
|
||||||
* If dtls_connect() is called but the handshake does not complete (e.g.
|
* If dtls_connect() is called but the handshake does not complete (e.g.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user