VirtualBox

Changeset 32818 in vbox


Ignore:
Timestamp:
Sep 29, 2010 3:28:35 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
66275
Message:

IPRT: RTTcpClientCloseEx - don't be nice to storage servers, they don't always repay the kindness.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/tcp.h

    r32276 r32818  
    180180
    181181/**
     182 * Close a socket returned by RTTcpClientConnect().
     183 *
     184 * @returns iprt status code.
     185 * @param   hSocket             The socket handle.
     186 * @param   fGracefulShutdown   If true, try do a graceful shutdown of the
     187 *                              outgoing pipe and draining any lingering input.
     188 *                              This is sometimes better for the server side.
     189 *                              If false, just close the connection without
     190 *                              further ado.
     191 */
     192RTR3DECL(int) RTTcpClientCloseEx(RTSOCKET Sock, bool fGracefulShutdown);
     193
     194/**
    182195 * Receive data from a socket.
    183196 *
  • trunk/src/VBox/Devices/Storage/DrvVD.cpp

    r32691 r32818  
    10441044
    10451045    if (pSockInt->hSocket != NIL_RTSOCKET)
    1046         rc = RTTcpClientClose(pSockInt->hSocket);
     1046        rc = RTTcpClientCloseEx(pSockInt->hSocket, false /*fGracefulShutdown*/);
    10471047
    10481048    RTMemFree(pSockInt);
     
    10721072            return VINF_SUCCESS;
    10731073
    1074         rc = RTTcpClientClose(pSockInt->hSocket);
     1074        rc = RTTcpClientCloseEx(pSockInt->hSocket, false /*fGracefulShutdown*/);
    10751075    }
    10761076
     
    10901090    }
    10911091
    1092     rc = RTTcpClientClose(pSockInt->hSocket);
     1092    rc = RTTcpClientCloseEx(pSockInt->hSocket, false /*fGracefulShutdown*/);
    10931093    pSockInt->hSocket = NIL_RTSOCKET;
    10941094
  • trunk/src/VBox/Main/MediumImpl.cpp

    r32780 r32818  
    54595459
    54605460    if (pSocketInt->hSocket != NIL_RTSOCKET)
    5461         RTTcpClientClose(pSocketInt->hSocket);
     5461        RTTcpClientCloseEx(pSocketInt->hSocket, false /*fGracefulShutdown*/);
    54625462
    54635463    RTMemFree(pSocketInt);
     
    54785478    PVDSOCKETINT pSocketInt = (PVDSOCKETINT)Sock;
    54795479
    5480     rc = RTTcpClientClose(pSocketInt->hSocket);
     5480    rc = RTTcpClientCloseEx(pSocketInt->hSocket, false /*fGracefulShutdown*/);
    54815481    pSocketInt->hSocket = NIL_RTSOCKET;
    54825482    return rc;
  • trunk/src/VBox/Runtime/r3/tcp.cpp

    r32810 r32818  
    919919
    920920
     921RTR3DECL(int) RTTcpClientCloseEx(RTSOCKET Sock, bool fGracefulShutdown)
     922{
     923    return rtTcpClose(Sock, "RTTcpClientCloseEx", fGracefulShutdown);
     924}
     925
     926
    921927#ifdef FIX_FOR_3_2
    922928/**
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