VirtualBox

Changeset 1654 in vbox for trunk/src/VBox/Devices/Serial


Ignore:
Timestamp:
Mar 23, 2007 10:22:45 AM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
19787
Message:

Wait a bit when nobody has connected yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Serial/DrvNamedPipe.cpp

    r1653 r1654  
    120120            DWORD uError = GetLastError();
    121121
    122             if (uError == ERROR_IO_PENDING)
     122            if (uError == ERROR_PIPE_LISTENING)
    123123            {
    124                 /* Wait for incoming bytes. */
    125                 if (GetOverlappedResult((HANDLE)pData->NamedPipe, &pData->OverlappedRead, (DWORD *)&cbReallyRead, TRUE) == FALSE)
     124                /* nobody connected yet */
     125                cbReallyRead = 0;
     126                RTThreadSleep(100);
     127            }
     128            else
     129            {
     130                if (uError == ERROR_IO_PENDING)
    126131                {
    127                     uError = GetLastError();
     132                    /* Wait for incoming bytes. */
     133                    if (GetOverlappedResult((HANDLE)pData->NamedPipe, &pData->OverlappedRead, (DWORD *)&cbReallyRead, TRUE) == FALSE)
     134                    {
     135                        uError = GetLastError();
     136                    }
    128137                }
     138
     139                rc = RTErrConvertFromWin32(uError);
     140                Log(("drvNamedPipeRead: ReadFile returned %d (%Vrc)\n", uError, rc));
    129141            }
    130 
    131             rc = RTErrConvertFromWin32(uError);
    132 
    133             Log(("drvNamedPipeRead: WriteFile returned %d (%Vrc)\n", uError, rc));
    134142        }
    135143
Note: See TracChangeset for help on using the changeset viewer.

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