summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2006-02-27 23:54:58 +0000
committerBenny Prijono <bennylp@teluu.com>2006-02-27 23:54:58 +0000
commite0da93da2f05d4ce4e3ed68618f74c94a4d0defc (patch)
tree46b6dc40a909526360d951c9db7c66b7b69fd9ef
parentbb660e1ca59d104bcc981c57f5662bf5e5479678 (diff)
Changed pjsip_endpt_handle_events() to return pj_status_t instead of void
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@248 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjsip/include/pjsip/sip_endpoint.h6
-rw-r--r--pjsip/src/pjsip/sip_endpoint.c14
2 files changed, 15 insertions, 5 deletions
diff --git a/pjsip/include/pjsip/sip_endpoint.h b/pjsip/include/pjsip/sip_endpoint.h
index 8b344db8..c9163ed8 100644
--- a/pjsip/include/pjsip/sip_endpoint.h
+++ b/pjsip/include/pjsip/sip_endpoint.h
@@ -108,9 +108,11 @@ PJ_DECL(const pj_str_t*) pjsip_endpt_name(const pjsip_endpoint *endpt);
* @param endpt The endpoint.
* @param max_timeout Maximum time to wait for events, or NULL to wait forever
* until event is received.
+ *
+ * @return PJ_SUCCESS on success.
*/
-PJ_DECL(void) pjsip_endpt_handle_events( pjsip_endpoint *endpt,
- const pj_time_val *max_timeout);
+PJ_DECL(pj_status_t) pjsip_endpt_handle_events( pjsip_endpoint *endpt,
+ const pj_time_val *max_timeout);
/**
diff --git a/pjsip/src/pjsip/sip_endpoint.c b/pjsip/src/pjsip/sip_endpoint.c
index 321dbb82..1c90816e 100644
--- a/pjsip/src/pjsip/sip_endpoint.c
+++ b/pjsip/src/pjsip/sip_endpoint.c
@@ -65,6 +65,9 @@ struct pjsip_endpoint
/** Ioqueue. */
pj_ioqueue_t *ioqueue;
+ /** Last ioqueue err */
+ pj_status_t ioq_last_err;
+
/** DNS Resolver. */
pjsip_resolver_t *resolver;
@@ -589,8 +592,8 @@ PJ_DEF(void) pjsip_endpt_release_pool( pjsip_endpoint *endpt, pj_pool_t *pool )
/*
* Handle events.
*/
-PJ_DEF(void) pjsip_endpt_handle_events( pjsip_endpoint *endpt,
- const pj_time_val *max_timeout)
+PJ_DEF(pj_status_t) pjsip_endpt_handle_events(pjsip_endpoint *endpt,
+ const pj_time_val *max_timeout)
{
/* timeout is 'out' var. This just to make compiler happy. */
pj_time_val timeout = { 0, 0};
@@ -611,7 +614,12 @@ PJ_DEF(void) pjsip_endpt_handle_events( pjsip_endpoint *endpt,
}
/* Poll ioqueue. */
- pj_ioqueue_poll( endpt->ioqueue, &timeout);
+ if (pj_ioqueue_poll( endpt->ioqueue, &timeout) < 0) {
+ pj_thread_sleep(1);
+ return pj_get_netos_error();
+ } else {
+ return PJ_SUCCESS;
+ }
}
/*