nsapi - Fixed open/close issue in Socket

During open, the socket checked the internal stack variable,
assuming it would alway be null on a socket not connected to
the network. However, when a socket is closed, the stack variable
was not updated, causing the socket to incorrectly return a
parameter error if reopened.

The simple fix was to set the stack to null on close. A non-null
stack is a predicate for a non-null socket variable, so no additional
checks are needed in socket functions.
pull/3402/head
Christopher Haster 2016-12-08 16:14:15 -06:00
parent 1b019c398b
commit 3643b59109
1 changed files with 1 additions and 0 deletions

View File

@ -60,6 +60,7 @@ nsapi_error_t Socket::close()
_socket = 0;
ret = _stack->socket_close(socket);
}
_stack = 0;
// Wakeup anything in a blocking operation
// on this socket