/* Disconnect and some other clean up. */ int ip_exit(ip_sock_t *ip) { ASSERT(ip); if (!ip->initialized) return 0; if (ip->socket > -1) { close(ip->socket); ip->socket = -1; } os_ip_support_cleanup(); ip->initialized = 0; return 0; }
/* Disconnect and some other clean up. */ int ip_shutdown(ip_sock_t *p_self) { if (p_self == NULL) { return RC_INVALID_POINTER; } if (!p_self->initialized) { return 0; } if (p_self->socket > -1) { close(p_self->socket); p_self->socket = -1; } os_ip_support_cleanup(); p_self->initialized = 0; return 0; }
/* Disconnect and some other clean up. */ RC_TYPE ip_shutdown(IP_SOCKET *p_self) { if (p_self == NULL) { return RC_INVALID_POINTER; } if (!p_self->initialized) { return RC_OK; } if (p_self->socket) { closesocket(p_self->socket); p_self->socket = 0; } os_ip_support_cleanup(); p_self->initialized = FALSE; return RC_OK; }