Skip to content

Commit f723f13

Browse files
committed
examples/dtls-sock: re-use handshake buffer
1 parent 4085b7f commit f723f13

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

examples/dtls-sock/dtls-client.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,10 @@ static int client_send(char *addr_str, char *data, size_t datalen)
151151
else {
152152
printf("Sent DTLS message\n");
153153

154-
uint8_t rcv[512];
155-
if ((res = sock_dtls_recv(&dtls_sock, &session, rcv, sizeof(rcv),
154+
if ((res = sock_dtls_recv(&dtls_sock, &session, buf, sizeof(buf),
156155
SOCK_NO_TIMEOUT)) >= 0) {
157156
printf("Received %" PRIdSIZE " bytes: \"%.*s\"\n", res, (int)res,
158-
(char *)rcv);
157+
(char *)buf);
159158
}
160159
}
161160

0 commit comments

Comments
 (0)