- bool nonblocking_send (std::string s);
- std::string blocking_get ();
- boost::optional<std::string> nonblocking_get ();
+ bool send (std::string s, int timeout);
+
+ /** Try to receive a message, waiting for some timeout before giving up.
+ * @param timeout Timeout in milliseconds, or -1 for infinite timeout.
+ * @return Empty if the timeout was reached, otherwise the received string.
+ */
+ boost::optional<std::string> receive (int timeout);