diff --git a/framework/engine/src/mm/services/net_channeled_interface.hpp b/framework/engine/src/mm/services/net_channeled_interface.hpp index 67b4afe..ef76de7 100644 --- a/framework/engine/src/mm/services/net_channeled_interface.hpp +++ b/framework/engine/src/mm/services/net_channeled_interface.hpp @@ -62,16 +62,23 @@ namespace MM::Services { //virtual bool getPacket // calls fn for each packet and fills in peer, channel, data_ptr, and data_size + // if fn retruns true, the packet will be deleted // returns number of fn calls - virtual size_t forEachPacket(std::function fn) = 0; + virtual size_t forEachPacket(std::function fn) = 0; // calls fn for each packet and fills in channel, data_ptr, and data_size + // if fn retruns true, the packet will be deleted // returns number of fn calls - virtual size_t forEachPacketPeer(peer_id peer, std::function fn) = 0; + virtual size_t forEachPacketPeer(peer_id peer, std::function fn) = 0; // calls fn for each packet and fills in data_ptr, and data_size + // if fn retruns true, the packet will be deleted // returns number of fn calls - virtual size_t forEachPacketPeerChannel(peer_id peer, channel_id channel, std::function fn) = 0; + virtual size_t forEachPacketPeerChannel(peer_id peer, channel_id channel, std::function fn) = 0; + + // deletes all packets + // it is a good idea to call this every once in a while, since garbage could accumulate + virtual void clearPackets(void) = 0; }; } // MM::Services