mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #9415 from SeppoTakalo/ONME-4140
Allow NSAPI_ERROR_UNSUPPORTED from Socket::setsockopt()pull/9286/head
commit
7b29593a41
|
@ -29,7 +29,16 @@ void TCPSOCKET_SETSOCKOPT_KEEPALIVE_VALID()
|
|||
TCPSocket sock;
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock.open(NetworkInterface::get_default_instance()));
|
||||
int32_t seconds = 7200;
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock.setsockopt(NSAPI_SOCKET, NSAPI_KEEPALIVE, &seconds, sizeof(int)));
|
||||
|
||||
int ret = sock.setsockopt(NSAPI_SOCKET, NSAPI_KEEPALIVE, &seconds, sizeof(int));
|
||||
|
||||
if (ret == NSAPI_ERROR_UNSUPPORTED) {
|
||||
TEST_IGNORE_MESSAGE("NSAPI_KEEPALIVE option not supported");
|
||||
sock.close();
|
||||
return;
|
||||
}
|
||||
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, ret);
|
||||
TEST_ASSERT_EQUAL(NSAPI_ERROR_OK, sock.connect(MBED_CONF_APP_ECHO_SERVER_ADDR, 9));
|
||||
// LWIP stack does not support getsockopt so the part below is commented out
|
||||
// int32_t optval;
|
||||
|
|
Loading…
Reference in New Issue