Exemple #1
0
void * serverThread(void * args)
{
    Server * me = (Server *) args;

    while(servStatus(me))
    {
        servLoop(me);
    }

    return NULL;
}
Exemple #2
0
void * serverThread(void * args)
{
    Server * me = (Server *) args;

    //listen on the given port
    if(listen(me->socket, me->queueLen) == -1)
    {
        perror("listen");
        servOff(me);
        return NULL;
    }

    //all clear, run the main loop function
    while(servStatus(me))
    {
        DEBUGOUT("calling servLoop()");
        servLoop(me);
    }

    delConnections(me);

    return NULL;
}