VirtualBox

Changeset 32276 in vbox for trunk/include


Ignore:
Timestamp:
Sep 7, 2010 11:33:52 AM (14 years ago)
Author:
vboxsync
Message:

IPRT/Socket: Add extended select API where the events to wait for can be provided

Location:
trunk/include/iprt
Files:
2 edited

Legend:

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

    r31103 r32276  
    149149RTDECL(int) RTSocketSelectOne(RTSOCKET hSocket, RTMSINTERVAL cMillies);
    150150
     151/** @name Select events
     152 * @{ */
     153/** Readable without blocking. */
     154#define RTSOCKET_EVT_READ         RT_BIT_32(0)
     155/** Writable without blocking. */
     156#define RTSOCKET_EVT_WRITE        RT_BIT_32(1)
     157/** Error condition, hangup, exception or similar. */
     158#define RTSOCKET_EVT_ERROR        RT_BIT_32(2)
     159/** Mask of the valid bits. */
     160#define RTSOCKET_EVT_VALID_MASK   UINT32_C(0x00000007)
     161/** @} */
     162
     163/**
     164 * Socket I/O multiplexing
     165 * Checks if the socket is ready for one of the given events.
     166 *
     167 * @returns iprt status code.
     168 * @param   Sock        Socket descriptor.
     169 * @param   fEvents     Event mask to wait for.
     170 * @param   pfEvents    Where to store the event mask on return.
     171 * @param   cMillies    Number of milliseconds to wait for the socket.
     172 *                      Use RT_INDEFINITE_WAIT to wait for ever.
     173 */
     174RTR3DECL(int)  RTSocketSelectOneEx(RTSOCKET Sock, uint32_t fEvents, uint32_t *pfEvents,
     175                                   RTMSINTERVAL cMillies);
     176
    151177/**
    152178 * Shuts down one or both directions of communciation.
  • trunk/include/iprt/tcp.h

    r31788 r32276  
    3232#include <iprt/net.h>
    3333#include <iprt/sg.h>
     34#include <iprt/socket.h>
    3435
    3536#ifdef IN_RING0
     
    234235RTR3DECL(int)  RTTcpSelectOne(RTSOCKET Sock, RTMSINTERVAL cMillies);
    235236
     237/**
     238 * Socket I/O multiplexing
     239 * Checks if the socket is ready for one of the given events.
     240 *
     241 * @returns iprt status code.
     242 * @param   Sock        Socket descriptor.
     243 * @param   fEvents     Event mask to wait for.
     244 *                      Use the RTSOCKET_EVT_* defines.
     245 * @param   pfEvents    Where to store the event mask on return.
     246 * @param   cMillies    Number of milliseconds to wait for the socket.
     247 *                      Use RT_INDEFINITE_WAIT to wait for ever.
     248 */
     249RTR3DECL(int)  RTTcpSelectOneEx(RTSOCKET Sock, uint32_t fEvents, uint32_t *pfEvents,
     250                                RTMSINTERVAL cMillies);
    236251
    237252#if 0 /* skipping these for now - RTTcpServer* handles this. */
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