mirror of https://github.com/ARMmbed/mbed-os.git
Remove shutdown parameter from close call
Pros - Simplifies interface - Easier base implementation Cons - May need shutdown functionality, in this case shutdown can be added as another function in the futurepull/2231/head
parent
a25aeea977
commit
41d7277a4b
|
|
@ -480,7 +480,7 @@ int LWIPInterface::socket_recvfrom(void *handle, SocketAddress *addr, void *buf,
|
|||
return copied;
|
||||
}
|
||||
|
||||
int LWIPInterface::socket_close(void *handle, bool shutdown)
|
||||
int LWIPInterface::socket_close(void *handle)
|
||||
{
|
||||
struct lwip_socket *s = (struct lwip_socket *)handle;
|
||||
|
||||
|
|
@ -490,10 +490,6 @@ int LWIPInterface::socket_close(void *handle, bool shutdown)
|
|||
return 0;
|
||||
|
||||
case NSAPI_TCP:
|
||||
if (shutdown) {
|
||||
tcp_abort(s->tcp);
|
||||
}
|
||||
|
||||
if (tcp_close(s->tcp)) {
|
||||
return NSAPI_ERROR_DEVICE_ERROR;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -161,9 +161,8 @@ protected:
|
|||
|
||||
/** Close the socket
|
||||
\param handle Socket handle
|
||||
\param shutdown free the left-over data in message queues
|
||||
*/
|
||||
virtual int socket_close(void *handle, bool shutdown);
|
||||
virtual int socket_close(void *handle);
|
||||
|
||||
/** Register a callback on when a new connection is ready
|
||||
\param handle Socket handle
|
||||
|
|
|
|||
Loading…
Reference in New Issue