Changeset 8571

Show
Ignore:
Timestamp:
10/14/10 17:28:16 (3 years ago)
Author:
sampson
Message:

Porting BMI TCP

Location:
branches/windows-client
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • branches/windows-client/src/io/bmi/bmi_wintcp/bmi-wintcp.c

    r8560 r8571  
    21902190        { 
    21912191            /* this is a little weird, but we complete the nonblocking 
    2192              * connection by polling */ 
    2193             /* 
     2192             * connection by polling */             
    21942193            poll_conn.fd = tcp_addr_data->socket; 
    21952194            poll_conn.events = POLLOUT; 
    2196             ret = poll(&poll_conn, 1, 2); 
     2195            ret = WSAPoll(&poll_conn, 1, 2); 
    21972196            if ((ret < 0) || (poll_conn.revents & POLLERR)) 
    21982197            { 
    2199                 tmp_errno = errno; 
    2200                 gossip_lerr("Error: poll: %s\n", strerror(tmp_errno)); 
     2198                tmp_errno = WSAGetLastError(); 
     2199                gossip_lerr("Error: poll: %d\n", tmp_errno); 
    22012200                return (bmi_tcp_errno_to_pvfs(-tmp_errno)); 
    22022201            } 
     
    22052204                tcp_addr_data->not_connected = 0; 
    22062205            } 
    2207             */ 
     2206 
    22082207            /* use select on Windows */ 
    2209            fd_set writefds; 
     2208           /*fd_set writefds; 
    22102209           struct timeval timeout; 
    22112210 
    22122211           timeout.tv_sec = 0; 
    22132212           timeout.tv_usec = 2000;   /* 2ms */ 
    2214  
     2213/* 
    22152214           FD_ZERO(&writefds); 
    22162215           FD_SET(tcp_addr_data->socket, &writefds); 
     
    22262225               tcp_addr_data->not_connected = 0; 
    22272226           } 
     2227*/ 
    22282228        } 
    22292229        /* return.  the caller should check the "not_connected" flag to 
     
    22882288    if (ret < 0) 
    22892289    { 
    2290         if (ret == -EINPROGRESS) 
     2290        if (ret == -WSAEWOULDBLOCK) 
    22912291        { 
    22922292            tcp_addr_data->not_connected = 1; 
  • branches/windows-client/src/io/bmi/bmi_wintcp/socket-collection.c

    r8560 r8571  
    314314 
    315315    /* nothing ready, just return */ 
    316     if(ret == 0) 
     316    if(ret == 0 && !pipe_notify) 
    317317    { 
    318318        return(0); 
  • branches/windows-client/src/io/bmi/bmi_wintcp/sockio.c

    r8554 r8571  
    8383        if (WSAGetLastError() == WSAEINTR) 
    8484            goto bind_sock_restart; 
    85         return(bmi_errno_to_pvfs(-errno)); 
     85        return(bmi_errno_to_pvfs(-WSAGetLastError())); 
    8686    } 
    8787    return (sockd); 
     
    104104        if (WSAGetLastError() == WSAEINTR) 
    105105            goto connect_sock_restart; 
    106         return(bmi_errno_to_pvfs(-errno)); 
     106        return(bmi_errno_to_pvfs(-WSAGetLastError())); 
    107107    } 
    108108    return (sockd); 
  • branches/windows-client/test/io/bmi/test-bmi-client.c

    r8556 r8571  
    296296    free(user_opts->hostid); 
    297297    free(user_opts); 
     298 
     299    getchar(); 
    298300 
    299301    return (0);