server/sock.c
/* wake anybody waiting on the socket event or send the associated message */
wake anybody waiting on the socket event or send the associated message
wake anybody waiting on the socket event or send the associated message
static void sock_wake_up( struct sock *sock )
{
    unsigned int events = sock->pmask & sock->mask;
    int i;
    if ( !events ) return;
    if (sock->event)
    {
        if (debug_level) fprintf(stderr, "signalling events %x ptr %p\n", events, sock->event );
        set_event( sock->event );
    }
    if (sock->window)
    {
        if (debug_level) fprintf(stderr, "signalling events %x win %08x\n", events, sock->window );
        for (i = 0; i < FD_MAX_EVENTS; i++)
        {
            int event = event_bitorder[i];
            if (sock->pmask & (1 << event))
            {
                lparam_t lparam = (1 << event) | (sock_get_error(sock->errors[event]) << 16);
                post_message( sock->window, sock->message, sock->wparam, lparam );
            }
        }
        sock->pmask = 0;
        sock_reselect( sock );
    }
}
static void sock_wake_up ( struct sock * sock ) { unsigned int events = sock -> pmask & sock -> mask ; int i ; if ( ! events ) return ; if ( sock -> event ) { if ( debug_level ) fprintf ( stderr , " \n " , events , sock -> event ) ; set_event ( sock -> event ) ; } if ( sock -> window ) { if ( debug_level ) fprintf ( stderr , " \n " , events , sock -> window ) ; for ( i = 0 ; i < FD_MAX_EVENTS ; i ++ ) { int event = event_bitorder [ i ] ; if ( sock -> pmask & ( 1 << event ) ) { lparam_t lparam = ( 1 << event ) | ( sock_get_error ( sock -> errors [ event ] ) << 16 ) ; post_message ( sock -> window , sock -> message , sock -> wparam , lparam ) ; } } sock -> pmask = 0 ; sock_reselect ( sock ) ; } }
wake anybody waiting on the socket event or send the associated message
wake anybody waiting on the socket event or send the associated message