示例#1
0
 static inline std::string escape_addr(const asio::ip::address& addr)
 {
     if (addr.is_v4())
     {
         return addr.to_v4().to_string();
     }
     else
     {
         return "[" + addr.to_v6().to_string() + "]";
     }
 }
示例#2
0
 static inline std::string anyaddr(const asio::ip::address& addr)
 {
     if (addr.is_v4() == true)
     {
         return addr.to_v4().any().to_string();
     }
     else
     {
         return addr.to_v6().any().to_string();
     }
     gu_throw_fatal;
     throw;
 }