X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/0872290a992e2f6db574c18ac36d1987318d477d..5f9d773575a07c0dd024cfc323d034d6181da9b6:/communicator.h?ds=inline diff --git a/communicator.h b/communicator.h index cfe8624..f9d096a 100644 --- a/communicator.h +++ b/communicator.h @@ -3,7 +3,7 @@ #ifndef COMMUNICATOR_H #define COMMUNICATOR_H -#include +#include #include #include "hostdata.h" #include "messages.h" @@ -24,14 +24,17 @@ public: // Try to get a message. Returns true on success. // Parameter "timeout" may be 0 for non-blocking operation, -1 for // infinite waiting, or any positive timeout. - bool recv(message*& msg, m_host_t& from, double timeout); + bool recv(message*& msg, m_host_t& from, double timeout) { + return received.pop(msg, from, timeout); + } private: // Myself const hostdata* host; // List of pending send communications - std::list sent_comm; + typedef std::vector sent_comm_type; + sent_comm_type sent_comm; // Queue of received messages message_queue received;