VirtualBox

Changeset 5938

Show
Ignore:
Timestamp:
12/03/07 10:57:50 (1 year ago)
Author:
vboxsync
Message:

iprt: small performance fix using the optimal fd number for select, and a slight cosmetic 101% correctness fix for the socket creation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/VBox/Runtime/r3/tcp.cpp

    r4071 r5938  
    770770    int rc; 
    771771    if (cMillies == RT_INDEFINITE_WAIT) 
    772         rc = select(FD_SETSIZE, &fdsetR, NULL, &fdsetE, NULL); 
     772        rc = select(Sock + 1, &fdsetR, NULL, &fdsetE, NULL); 
    773773    else 
    774774    { 
     
    776776        timeout.tv_sec = cMillies / 1000; 
    777777        timeout.tv_usec = (cMillies % 1000) * 1000; 
    778         rc = select(FD_SETSIZE, &fdsetR, NULL, &fdsetE, &timeout); 
     778        rc = select(Sock + 1, &fdsetR, NULL, &fdsetE, &timeout); 
    779779    } 
    780780    if (rc > 0) 
     
    831831     * Create the socket and connect. 
    832832     */ 
    833     RTSOCKET Sock = socket(AF_INET, SOCK_STREAM, 0); 
     833    RTSOCKET Sock = socket(PF_INET, SOCK_STREAM, 0); 
    834834    if (Sock != -1) 
    835835    { 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy