From d7923f08cab62ef40027a92f596ff45428870838 Mon Sep 17 00:00:00 2001 From: Fabien Ninoles Date: Fri, 17 Jun 2011 12:22:02 +0200 Subject: Add sockopt ZMQ_RCVTIMEO/ZMQ_SNDTIMEO. - Add doc and tests - Add options and setup - Wait using poll/select Signed-off-by: Fabien Ninoles Signed-off-by: Martin Sustrik --- src/mailbox.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/mailbox.hpp') diff --git a/src/mailbox.hpp b/src/mailbox.hpp index 96bf4eb..1b54aac 100644 --- a/src/mailbox.hpp +++ b/src/mailbox.hpp @@ -41,7 +41,7 @@ namespace zmq fd_t get_fd (); void send (const command_t &cmd_); - int recv (command_t *cmd_, bool block_); + int recv (command_t *cmd_, int timeout_); private: @@ -52,6 +52,11 @@ namespace zmq // Platform-dependent function to create a socketpair. static int make_socketpair (fd_t *r_, fd_t *w_); + // Receives a command with the specific timeout. + // This function is not to be used for non-blocking or inifinitely + // blocking recvs. + int recv_timeout (command_t *cmd_, int timeout_); + // Disable copying of mailbox_t object. mailbox_t (const mailbox_t&); const mailbox_t &operator = (const mailbox_t&); -- cgit v1.2.3