VirtualBox

Changeset 38108 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Jul 21, 2011 5:19:16 PM (14 years ago)
Author:
vboxsync
Message:

NAT: lets host's TCP/IP stack limit the queue of requests to listeinig socket.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/socket.c

    r38057 r38108  
    10171017    addr.sin_port = port;
    10181018
     1019    /**
     1020     * changing listen(,1->SOMAXCONN) shouldn't be harmful for NAT's TCP/IP stack,
     1021     * kernel will choose the optimal value for requests queue length.
     1022     * @note: MSDN recommends low (2-4) values for bluetooth networking devices.
     1023     */
    10191024    if (   ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0)
    10201025        || (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,(char *)&opt, sizeof(int)) < 0)
    10211026        || (bind(s,(struct sockaddr *)&addr, sizeof(addr)) < 0)
    1022         || (listen(s, 1) < 0))
     1027        || (listen(s, SOMAXCONN) < 0))
    10231028    {
    10241029#ifdef RT_OS_WINDOWS
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