X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=include%2Fyaz%2Fzoom.h;h=8dcbcf61a159eaa8a3fde8e7748b6393f0b77299;hb=4b768398f592fe19364a3079d968da2f3a9e724f;hp=11282398aaf9dc19b5a143c7ad290d95935fccfa;hpb=951fce6496397a6d8c11e15ab5b60b46abc43467;p=yaz-moved-to-github.git diff --git a/include/yaz/zoom.h b/include/yaz/zoom.h index 1128239..8dcbcf6 100644 --- a/include/yaz/zoom.h +++ b/include/yaz/zoom.h @@ -24,7 +24,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $Id: zoom.h,v 1.42 2007-01-09 13:56:48 adam Exp $ */ +/* $Id: zoom.h,v 1.44 2007-01-12 21:03:30 adam Exp $ */ /** * \file zoom.h @@ -370,21 +370,38 @@ ZOOM_API(int) ZOOM_connection_is_idle(ZOOM_connection c); -/** \brief processes one event for one of connections given +/** \brief process one event for one of connections given \param no number of connections (size of cs) \param cs connection array \retval 0 no event was processed \retval >0 event was processed for connection at (retval-1) + This function attemps to deal with outstandings events in a non-blocking + mode. If no events was processed (return value of 0), then the system + should attempt to deal with sockets in blocking mode using socket + select/poll which means calling the following functions: + ZOOM_connection_get_socket, ZOOM_connection_get_mask, + ZOOM_connection_get_timeout. +*/ +ZOOM_API(int) + ZOOM_event_nonblock(int no, ZOOM_connection *cs); + + +/** \brief process one event for connection + \param c connection + \retval 0 no event was processed + \retval 1 event was processed for connection + This function attemps to deal with outstandings events in - a non-blocking fashion. If no events was processed (return value of 0), + a non-blocking fashion. If no event was processed (return value of 0), then the system should attempt to deal with sockets in blocking mode using socket select/poll which means calling the following functions: ZOOM_connection_get_socket, ZOOM_connection_get_mask, - ZOOM_connection_get_timeout. + ZOOM_connection_get_timeout. If an event was processed call this + function again. */ ZOOM_API(int) - ZOOM_process_event(int no, ZOOM_connection *cs); + ZOOM_connection_process(ZOOM_connection c); /** \brief get socket fd for ZOOM connection @@ -449,6 +466,17 @@ ZOOM_API(int) +/** \brief peek at next event + \param c connection + \returns ZOOM_EVENT_NONE (for no events in queue), ZOOM_EVENT_CONNECT, .. + + Does not actually remove the event from the event queue. ZOOM_event and + ZOOM_process_event removes one event. +*/ + +ZOOM_API(int) + ZOOM_connection_peek_event(ZOOM_connection c); + ZOOM_END_CDECL /* * Local variables: