diff options
author | Fabien Ninoles <fabien@tzone.org> | 2011-06-17 12:22:02 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2011-06-17 12:22:02 +0200 |
commit | d7923f08cab62ef40027a92f596ff45428870838 (patch) | |
tree | 370ad14bc9d1ebbc14f9d5f8077f81e28e301f5f /src/mailbox.hpp | |
parent | 65d2b70312efb148814b58d9cd38cc7069b53a3b (diff) |
Add sockopt ZMQ_RCVTIMEO/ZMQ_SNDTIMEO.
- Add doc and tests
- Add options and setup
- Wait using poll/select
Signed-off-by: Fabien Ninoles <fabien@tzone.org>
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/mailbox.hpp')
-rw-r--r-- | src/mailbox.hpp | 7 |
1 files changed, 6 insertions, 1 deletions
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&); |