X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fnanomsg.h;h=8d89d6d99fee05b641ed5213d83d9145f42d4b32;hb=a6f2b7b15a4d80c9bcd763765fc7ccd7407f6820;hp=9bd87098b4814465fd4773a876fb0ef5566464c0;hpb=350afcbc40fffd8c8780180e153a2ee91088f562;p=dcpomatic.git diff --git a/src/lib/nanomsg.h b/src/lib/nanomsg.h index 9bd87098b..8d89d6d99 100644 --- a/src/lib/nanomsg.h +++ b/src/lib/nanomsg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2020 Carl Hetherington + Copyright (C) 2020-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,22 +18,27 @@ */ + #include #include #include -#include -class Nanomsg : public boost::noncopyable + +class Nanomsg { public: explicit Nanomsg (bool server); + ~Nanomsg (); + + Nanomsg (Nanomsg const&) = delete; + Nanomsg& operator= (Nanomsg const&) = delete; /** Try to send a message, waiting for some timeout before giving up. * @param timeout Timeout in milliseconds, or -1 for infinite timeout. * @return true if the send happened, false if there was a timeout. */ 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. @@ -45,6 +50,7 @@ private: void recv_and_parse (int flags); int _socket; + int _endpoint; std::list _pending; std::string _current; };