VirtualBox

Changeset 58435 in vbox


Ignore:
Timestamp:
Oct 27, 2015 4:15:30 PM (9 years ago)
Author:
vboxsync
Message:

GIMDev: Fix for localhost sockets on linux hosts terminating the debug receive thread prematurely.

Location:
trunk/src/VBox/Devices/GIMDev
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/GIMDev/DrvUDP.cpp

    r58390 r58435  
    104104    {
    105105        size_t cbBuf = *pcbWrite;
    106         rc = RTSocketWriteToNB(pThis->hSocket, pvBuf, cbBuf, NULL /*pDstAddr*/);
     106        rc = RTSocketWriteTo(pThis->hSocket, pvBuf, cbBuf, NULL /*pDstAddr*/);
    107107        if (RT_SUCCESS(rc))
    108108            *pcbWrite = cbBuf;
     
    147147    if (pThis->hSocket != NIL_RTSOCKET)
    148148    {
     149        /*
     150         * We shutdown the socket here to poke out any blocking socket reads. The caller
     151         * on the other thread/s need to ensure that they do -not- invoke drvUDPRead()
     152         * or drvUDPWrite() after this.
     153         */
    149154        RTSocketRetain(pThis->hSocket);
    150155        RTSocketShutdown(pThis->hSocket, true, true);
  • trunk/src/VBox/Devices/GIMDev/GIMDev.cpp

    r58390 r58435  
    140140            }
    141141        }
     142#ifdef RT_OS_LINUX
     143        else if (rc == VERR_NET_CONNECTION_REFUSED)
     144        {
     145            /*
     146             * With the current, simplistic PDMISTREAM interface, this is the best we can do.
     147             * Even using RTSocketSelectOne[Ex] on Linux returns immediately with 'ready-to-read'
     148             * on localhost UDP sockets that are not connected on the other end.
     149             */
     150            /** @todo Fix socket waiting semantics on localhost Linux unconnected UDP sockets. */
     151            RTThreadSleep(400);
     152        }
     153#endif
    142154        else if (   rc != VINF_TRY_AGAIN
    143155                 && rc != VERR_TRY_AGAIN)
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