Exemplo n.º 1
0
void in_Rsocklisten(int *sockp, char **buf, int *len)
{
    check_init();
    perr.error = 0;
    *sockp = enter_sock(Sock_listen(*sockp, *buf , *len, &perr));
    if(perr.error) REprintf("socket error: %s\n", strerror(perr.error));
}
Exemplo n.º 2
0
int R_SockListen(int sockp, char *buf, int len, int timeout)
{
    check_init();
    /* inserting a wait here will eliminate most blocking, but there
       are scenarios under which the Sock_listen call might block
       after the wait has completed. LT */
    R_SocketWait(sockp, 0, timeout);
    return Sock_listen(sockp, buf, len, NULL);
}
Exemplo n.º 3
0
int R_SockListen(int sockp, char *buf, int len, int timeout)
{
    check_init();
    /* inserting a wait here will eliminate most blocking, but there
       are scenarios under which the Sock_listen call might block
       after the wait has completed. LT */
    int res = 0;
    do {
        res = R_SocketWait(sockp, 0, timeout);
    } while (res < 0 && -res == EINTR);
    if(res != 0)
        return -1;              /* socket error or timeout */
    return Sock_listen(sockp, buf, len, NULL);
}