/* This function will register TLS protocol to the global TLS protocol. */
struct sal_socket* sal_get_socket(int socket)
/* This function will register TLS protocol to the global TLS protocol. */
struct sal_socket* sal_get_socket(int socket)
{
    struct sal_socket_table *st = &socket_table;
    socket = socket - SAL_SOCKET_OFFSET;
    if (socket < 0 || socket >= (int) st->max_socket)
    {
        return RT_NULL;
    }
    RT_ASSERT(st->sockets[socket]->magic == SAL_SOCKET_MAGIC);
    return st->sockets[socket];
}