-set socket options before “socket.bind” -listen for incoming SOCK_STREAM connections only before “socket.accept” resolves ubuntu errors.
Fork of NSAPITests by
Diff: NSAPITests.cpp
- Revision:
- 8:5a5c498e1fa0
- Parent:
- 7:444bc156318f
- Child:
- 9:07b22947be75
diff -r 444bc156318f -r 5a5c498e1fa0 NSAPITests.cpp --- a/NSAPITests.cpp Thu Mar 03 14:19:34 2016 -0600 +++ b/NSAPITests.cpp Thu Mar 03 20:39:45 2016 +0000 @@ -4,7 +4,7 @@ #include <stdio.h> #include "string.h" -#define NSAPI_MAX_DATA_SIZE 1000 +#define NSAPI_MAX_DATA_SIZE 500 char expected_data[NSAPI_MAX_DATA_SIZE]; char received_data[NSAPI_MAX_DATA_SIZE]; @@ -142,7 +142,7 @@ int nsapi_socket_blocking_test(Socket *socket, const char *test_address, uint16_t test_port) { int32_t result, i; - int32_t packet_sizes[] = {10, 100, 1000}; + int32_t packet_sizes[] = {10, 100, 500}; int32_t num_packet_sizes = 3; for (i = 0; i < num_packet_sizes; i++) { @@ -197,7 +197,6 @@ result = 0; break; } else { - printf("'recv' returned incorrect data\r\n"); result = -2; break; } @@ -221,7 +220,7 @@ int nsapi_socket_non_blocking_test(Socket *socket, const char *test_address, uint16_t test_port) { int32_t result, i; - int32_t packet_sizes[] = {10, 100, 1000}; + int32_t packet_sizes[] = {10, 100, 500}; int32_t num_packet_sizes = 3; for (i = 0; i < num_packet_sizes; i++) {