/* Free a socket. The socket's netconn must have been delete before! */
static void free_socket(lwIP_sock *sock)
/* Free a socket. The socket's netconn must have been delete before! */
static void free_socket(lwIP_sock *sock)
{
    void *lastdata = NULL;
    sock->conn = NULL;
    sock->recv_data_len = 0;
    sock->recv_index = 0;
    sock->send_buffer = NULL;
    sock->send_index = 0;
}