fix(tw16355): examples/protocols/coap_client(server)

fix coap example can not work properly
pull/1278/merge
zhangjunhao 2017-11-15 11:58:19 +08:00
rodzic ec9d93f4fc
commit 6a02a58347
2 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -139,7 +139,7 @@ static void coap_example_task(void *p)
FD_ZERO(&readfds);
FD_CLR( ctx->sockfd, &readfds );
FD_SET( ctx->sockfd, &readfds );
result = select( FD_SETSIZE, &readfds, 0, 0, &tv );
result = select( ctx->sockfd+1, &readfds, 0, 0, &tv );
if (result > 0) {
if (FD_ISSET( ctx->sockfd, &readfds ))
coap_read(ctx);

Wyświetl plik

@ -120,7 +120,7 @@ static void coap_example_thread(void *p)
FD_CLR( ctx->sockfd, &readfds);
FD_SET( ctx->sockfd, &readfds);
int result = select( FD_SETSIZE, &readfds, 0, 0, &tv );
int result = select( ctx->sockfd+1, &readfds, 0, 0, &tv );
if (result > 0){
if (FD_ISSET( ctx->sockfd, &readfds ))
coap_read(ctx);