diff --git a/include/snipplib/containers/snplib_hmap.h b/include/snipplib/containers/snplib_hmap.h index 997fafd..ba893fa 100644 --- a/include/snipplib/containers/snplib_hmap.h +++ b/include/snipplib/containers/snplib_hmap.h @@ -163,10 +163,14 @@ public: [](KeyT const& k, const HeterogenMap* obj) { return _values[obj].contains(k); }); _clearFunc.emplace_back([](HeterogenMap* obj) { - _values[obj].clear(); + _values.erase(obj); - _getter[obj].clear(); - _setter[obj].clear(); + _getter.erase(obj); + _setter.erase(obj); + // _values[obj].clear(); + + // _getter[obj].clear(); + // _setter[obj].clear(); }); _sizeFunc.emplace_back([](const HeterogenMap* obj) { return _values[obj].size(); }); diff --git a/include/snipplib/network/snplib_endpoint.h b/include/snipplib/network/snplib_endpoint.h index 28da349..316826e 100644 --- a/include/snipplib/network/snplib_endpoint.h +++ b/include/snipplib/network/snplib_endpoint.h @@ -50,14 +50,21 @@ public: PROTO_ID_SERLOCAL, PROTO_ID_TCP, PROTO_ID_TLS, + PROTO_ID_UDP, + PROTO_ID_WS, + PROTO_ID_WSS, PROTO_ID_UNKNOWN }; static constexpr std::string_view protoMarkLocal{"local"}; // UNIX domain static constexpr std::string_view protoMarkTCP{"tcp"}; // TCP static constexpr std::string_view protoMarkTLS{"tls"}; // TLS + static constexpr std::string_view protoMarkUDP{"udp"}; // UDP + static constexpr std::string_view protoMarkWS{"ws"}; // Websocket + static constexpr std::string_view protoMarkWSS{"wss"}; // Secure Websocket - static constexpr std::array validProtoMarks{protoMarkLocal, protoMarkTCP, protoMarkTLS}; + static constexpr std::array validProtoMarks{protoMarkLocal, protoMarkTCP, protoMarkTLS, + protoMarkUDP, protoMarkWS, protoMarkWSS}; static constexpr std::string_view localProtoTypeStream{"stream"}; // UNIX domain stream @@ -325,6 +332,21 @@ public: return proto() == protoMarkTLS; } + bool isUDP() const + { + return proto() == protoMarkUDP; + } + + + bool isWS() const + { + return proto() == protoMarkWS; + } + + bool isWSS() const + { + return proto() == protoMarkWSS; + } // add '\0' char (or replace special-meaning char/char-sequence) to construct UNIX abstract namespace // endpoint path