VirtualBox

Changeset 5938 in vbox


Ignore:
Timestamp:
Dec 3, 2007 9:57:50 AM (17 years 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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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    {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette