diff options
author | Benny Prijono <bennylp@teluu.com> | 2008-08-04 09:59:02 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2008-08-04 09:59:02 +0000 |
commit | f2b03bec9115d384456098eada81efc9707df24a (patch) | |
tree | 6703eebe275db1eead1efce0105eff66c4e6f7ad /pjlib/include/pj/activesock.h | |
parent | a589ed37b097e63e853a3ad356b4605b767cf4a8 (diff) |
Added new active socket API's to specify application buffers in start_read() and start_recv() functions
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2187 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/include/pj/activesock.h')
-rw-r--r-- | pjlib/include/pj/activesock.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/pjlib/include/pj/activesock.h b/pjlib/include/pj/activesock.h index f465de83..71662190 100644 --- a/pjlib/include/pj/activesock.h +++ b/pjlib/include/pj/activesock.h @@ -356,6 +356,26 @@ PJ_DECL(pj_status_t) pj_activesock_start_read(pj_activesock_t *asock, pj_uint32_t flags); /** + * Same as #pj_activesock_start_read(), except that the application + * supplies the buffers for the read operation so that the acive socket + * does not have to allocate the buffers. + * + * @param asock The active socket. + * @param pool Pool used to allocate buffers for incoming data. + * @param buff_size The size of each buffer, in bytes. + * @param readbuf Array of packet buffers, each has buff_size size. + * @param flags Flags to be given to pj_ioqueue_recv(). + * + * @return PJ_SUCCESS if the operation has been successful, + * or the appropriate error code on failure. + */ +PJ_DECL(pj_status_t) pj_activesock_start_read2(pj_activesock_t *asock, + pj_pool_t *pool, + unsigned buff_size, + void *readbuf[], + pj_uint32_t flags); + +/** * Same as pj_activesock_start_read(), except that this function is used * only for datagram sockets, and it will trigger \a on_data_recvfrom() * callback instead. @@ -374,6 +394,26 @@ PJ_DECL(pj_status_t) pj_activesock_start_recvfrom(pj_activesock_t *asock, pj_uint32_t flags); /** + * Same as #pj_activesock_start_recvfrom() except that the recvfrom() + * operation takes the buffer from the argument rather than creating + * new ones. + * + * @param asock The active socket. + * @param pool Pool used to allocate buffers for incoming data. + * @param buff_size The size of each buffer, in bytes. + * @param readbuf Array of packet buffers, each has buff_size size. + * @param flags Flags to be given to pj_ioqueue_recvfrom(). + * + * @return PJ_SUCCESS if the operation has been successful, + * or the appropriate error code on failure. + */ +PJ_DECL(pj_status_t) pj_activesock_start_recvfrom2(pj_activesock_t *asock, + pj_pool_t *pool, + unsigned buff_size, + void *readbuf[], + pj_uint32_t flags); + +/** * Send data using the socket. * * @param asock The active socket. |