VirtualBox

Changeset 27787 in vbox for trunk/include


Ignore:
Timestamp:
Mar 29, 2010 12:39:25 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
59441
Message:

iprt: RTSocket/RTTcp: refcount the sockets the RTDbg* way.

Location:
trunk/include/iprt
Files:
4 edited

Legend:

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

    r27576 r27787  
    613613/** Concurrent access to the object is not allowed. */
    614614#define VERR_CONCURRENT_ACCESS              (-92)
     615/** The caller does not have a reference to the object.
     616 * This status is used when two threads is caught sharing the same object
     617 * reference. */
     618#define VERR_CALLER_NO_REFERENCE            (-93)
    615619/** Invalid login data given. */
    616 #define VERR_LOGON_FAILURE                  (-93)
     620#define VERR_LOGON_FAILURE                  (-94)
    617621/** @} */
    618622
  • trunk/include/iprt/mempool.h

    r20374 r27787  
    124124 * Frees memory allocated from a pool.
    125125 *
    126  * @param   hMemPool        Handle to the pool containing the memory. Passing
     126 * @param   hMemPool        Handle to the pool containing the memory.  Passing
    127127 *                          NIL here is fine, but it may come at a slight
    128128 *                          performance cost.
     
    146146 * Releases a reference to a memory block in a pool.
    147147 *
    148  * @param   hMemPool        Handle to the pool containing the memory. Passing
     148 * @returns New reference count, UINT32_MAX on error (asserted).
     149 *
     150 * @param   hMemPool        Handle to the pool containing the memory.  Passing
    149151 *                          NIL here is fine, but it may come at a slight
    150152 *                          performance cost.
     
    153155RTDECL(uint32_t) RTMemPoolRelease(RTMEMPOOL hMemPool, void *pv) RT_NO_THROW;
    154156
     157/**
     158 * Get the current reference count.
     159 *
     160 * @returns The reference count, UINT32_MAX on error (asserted).
     161 * @param   pv              Pointer to memory block.
     162 */
     163RTDECL(uint32_t) RTMemPoolRefCount(void *pv) RT_NO_THROW;
     164
    155165
    156166RT_C_DECLS_END
  • trunk/include/iprt/socket.h

    r27503 r27787  
    4949
    5050/**
    51  * Destroys the specified handle, freeing associated resources and closing the
    52  * socket.
     51 * Retains a reference to the socket handle.
     52 *
     53 * @returns New reference count, UINT32_MAX on invalid handle (asserted).
     54 *
     55 * @param   hSocket         The socket handle.
     56 */
     57RTDECL(uint32_t) RTSocketRetain(RTSOCKET hSocket);
     58
     59/**
     60 * Release a reference to the socket handle.
     61 *
     62 * When the reference count reaches zero, the socket handle is shut down and
     63 * destroyed.  This will not be graceful shutdown, use the protocol specific
     64 * close method if this is desired.
     65 *
     66 * @returns New reference count, UINT32_MAX on invalid handle (asserted).
     67 *
     68 * @param   hSocket         The socket handle.  The NIL handle is quietly
     69 *                          ignored and 0 is returned.
     70 */
     71RTDECL(uint32_t) RTSocketRelease(RTSOCKET hSocket);
     72
     73/**
     74 * Shuts down the socket, close it and then release one handle reference.
     75 *
     76 * This is slightly different from RTSocketRelease which will first do the
     77 * shutting down and closing when the reference count reaches zero.
    5378 *
    5479 * @returns IPRT status code.
     
    5984 *          desired.
    6085 */
    61 RTDECL(int) RTSocketDestroy(RTSOCKET hSocket);
     86RTDECL(int) RTSocketClose(RTSOCKET hSocket);
    6287
    6388/**
  • trunk/include/iprt/tcp.h

    r27497 r27787  
    136136 *
    137137 * @param   pServer         The server handle as returned from RTTcpServerCreateEx().
    138  * @param   pSockClient     Where to return the socket handle to the client
    139  *                          connection (on success only).  Use
    140  *                          RTTcpServerDisconnectClient() to clean it, this must
    141  *                          be done before the next call to RTTcpServerListen2.
    142  *
    143  * @todo    This can easily be extended to support multiple connections by
    144  *          adding a new state and a RTTcpServerDisconnectClient variant for
    145  *          closing client sockets.
    146  */
    147 RTR3DECL(int) RTTcpServerListen2(PRTTCPSERVER pServer, PRTSOCKET pSockClient);
     138 * @param   phClientSocket  Where to return the socket handle to the client
     139 *                          connection (on success only).  This must be closed
     140 *                          by calling RTTcpServerDisconnectClient2().
     141 */
     142RTR3DECL(int) RTTcpServerListen2(PRTTCPSERVER pServer, PRTSOCKET phClientSocket);
    148143
    149144/**
     
    154149 */
    155150RTR3DECL(int) RTTcpServerDisconnectClient(PRTTCPSERVER pServer);
     151
     152/**
     153 * Terminates an open client connect when using RTTcpListen2
     154 *
     155 * @returns IPRT status code.
     156 * @param   hClientSocket   The client socket handle.  This will be invalid upon
     157 *                          return, whether successful or not.  NIL is quietly
     158 *                          ignored (VINF_SUCCESS).
     159 */
     160RTR3DECL(int) RTTcpServerDisconnectClient2(RTSOCKET hClientSocket);
    156161
    157162/**
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