summaryrefslogtreecommitdiff
path: root/pjlib/include
diff options
context:
space:
mode:
authorRiza Sulistyo <riza@teluu.com>2013-04-05 03:02:19 +0000
committerRiza Sulistyo <riza@teluu.com>2013-04-05 03:02:19 +0000
commit3c8d3b370e33627a0a08a3bcfceaf9709e4a3991 (patch)
tree7e65b6d873106dd32e1809f9c59ee64bb5329a6c /pjlib/include
parentcebde64ea044c362999974b662dc3e58e0577778 (diff)
Re #1643: Code restructure+add callback to support symbian gui app
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4461 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/include')
-rw-r--r--pjlib/include/pj/activesock.h27
-rw-r--r--pjlib/include/pj/errno.h5
2 files changed, 31 insertions, 1 deletions
diff --git a/pjlib/include/pj/activesock.h b/pjlib/include/pj/activesock.h
index 11fa6589..e1584719 100644
--- a/pjlib/include/pj/activesock.h
+++ b/pjlib/include/pj/activesock.h
@@ -132,7 +132,8 @@ typedef struct pj_activesock_cb
/**
* This callback is called when new connection arrives as the result
- * of pj_activesock_start_accept().
+ * of pj_activesock_start_accept(). If the status of accept operation is
+ * needed use on_accept_complete2 instead of this callback.
*
* @param asock The active socket.
* @param newsock The new incoming socket.
@@ -150,6 +151,30 @@ typedef struct pj_activesock_cb
int src_addr_len);
/**
+ * This callback is called when new connection arrives as the result
+ * of pj_activesock_start_accept().
+ *
+ * @param asock The active socket.
+ * @param newsock The new incoming socket.
+ * @param src_addr The source address of the connection.
+ * @param addr_len Length of the source address.
+ * @param status The status of the accept operation. This may contain
+ * non-PJ_SUCCESS for example when the TCP listener is in
+ * bad state for example on iOS platform after the
+ * application waking up from background.
+ *
+ * @return PJ_TRUE if further accept() is desired, and PJ_FALSE
+ * when application no longer wants to accept incoming
+ * connection. Application may destroy the active socket
+ * in the callback and return PJ_FALSE here.
+ */
+ pj_bool_t (*on_accept_complete2)(pj_activesock_t *asock,
+ pj_sock_t newsock,
+ const pj_sockaddr_t *src_addr,
+ int src_addr_len,
+ pj_status_t status);
+
+ /**
* This callback is called when pending connect operation has been
* completed.
*
diff --git a/pjlib/include/pj/errno.h b/pjlib/include/pj/errno.h
index e9e403ce..05008b10 100644
--- a/pjlib/include/pj/errno.h
+++ b/pjlib/include/pj/errno.h
@@ -427,6 +427,11 @@ PJ_DECL(pj_status_t) pj_register_strerror(pj_status_t start_code,
* Object no longer exists
*/
#define PJ_EGONE (PJ_ERRNO_START_STATUS + 23)/* 70023 */
+/**
+ * @hideinitializer
+ * Socket is stopped
+ */
+#define PJ_ESOCKETSTOP (PJ_ERRNO_START_STATUS + 24)/* 70024 */
/** @} */ /* pj_errnum */