VirtualBox

Changeset 78821 in vbox


Ignore:
Timestamp:
May 28, 2019 2:16:34 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
130918
Message:

IPRT/socket.h: Added RTTcpSetBufferSize. bugref:9474

Location:
trunk
Files:
3 edited

Legend:

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

    r78733 r78821  
    22362236# define RTTcpServerShutdown                            RT_MANGLER(RTTcpServerShutdown)
    22372237# define RTTcpSetSendCoalescing                         RT_MANGLER(RTTcpSetSendCoalescing)
     2238# define RTTcpSetBufferSize                             RT_MANGLER(RTTcpSetBufferSize)
    22382239# define RTTcpSgWrite                                   RT_MANGLER(RTTcpSgWrite)
    22392240# define RTTcpSgWriteL                                  RT_MANGLER(RTTcpSgWriteL)
  • trunk/include/iprt/tcp.h

    r76585 r78821  
    291291
    292292/**
     293 * Sets send and receive buffer sizes.
     294 *
     295 * @returns iprt status code.
     296 * @param   hSocket     Socket descriptor.
     297 * @param   cbSize      Buffer size in bytes.
     298 */
     299RTR3DECL(int)  RTTcpSetBufferSize(RTSOCKET hSocket, uint32_t cbSize);
     300
     301/**
    293302 * Socket I/O multiplexing.
    294303 * Checks if the socket is ready for reading.
  • trunk/src/VBox/Runtime/r3/tcp.cpp

    r76553 r78821  
    10781078
    10791079
     1080RTR3DECL(int)  RTTcpSetBufferSize(RTSOCKET hSocket, uint32_t cbSize)
     1081{
     1082    int cbIntSize = (int)cbSize;
     1083    AssertReturn(cbIntSize >= 0, VERR_OUT_OF_RANGE);
     1084    int rc = rtSocketSetOpt(hSocket, SOL_SOCKET, SO_SNDBUF, &cbIntSize, sizeof(cbIntSize));
     1085    if (RT_SUCCESS(rc))
     1086        rc = rtSocketSetOpt(hSocket, SOL_SOCKET, SO_RCVBUF, &cbIntSize, sizeof(cbIntSize));
     1087    return rc;
     1088}
     1089
     1090
    10801091RTR3DECL(int)  RTTcpSelectOne(RTSOCKET Sock, RTMSINTERVAL cMillies)
    10811092{
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