| 266 | } |
| 267 | |
| 268 | UInt16 SocketAddress::SplitLiteral(const char* value,string& host) { |
| 269 | UInt16 port(0); |
| 270 | host.assign(value); |
| 271 | const char* colon(strchr(value,':')); |
| 272 | if (colon && String::ToNumber(colon+1, port)) // check if it's really a marker port colon (could be a IPv6 colon) |
| 273 | host.resize(colon-value); |
| 274 | return port; |
| 275 | } |
| 276 | |
| 277 | } // namespace Mona |