#include "EndPoint.h" /////////////////////////////////////////////////////////////// // Manage endpoints EndPoint::EndPoint(const std::string& address, long port) { ep = address + ":" + ::ToString(port); } EndPoint::EndPoint(const std::string& eps) : ep(eps) {} std::string EndPoint::address() { size_t pos = ep.find(":"); return ep.substr(0,pos); } long EndPoint::port() { size_t pos = ep.find(":"); std::string pnum = ep.substr(pos+1); return FromString(pnum); } std::string& EndPoint::ToString() { return ep; } #ifdef TEST_ENDPOINT void main() { } #endif