| 138 | } |
| 139 | |
| 140 | static IPv4Address* Parse(Exception& ex,const char* address) { |
| 141 | if (!address || !Net::InitializeNetwork(ex)) |
| 142 | return 0; |
| 143 | if (String::ICompare(address, "localhost") == 0) |
| 144 | address = LocalhostV4; |
| 145 | struct in_addr ia; |
| 146 | #if defined(_WIN32) |
| 147 | ia.s_addr = inet_addr(address); |
| 148 | if (ia.s_addr == INADDR_NONE && strcmp(address,"255.255.255.255")!=0) |
| 149 | return 0; |
| 150 | return new IPv4Address(ia); |
| 151 | #else |
| 152 | if (inet_aton(address, &ia)) |
| 153 | return new IPv4Address(ia); |
| 154 | return 0; |
| 155 | #endif |
| 156 | } |
| 157 | |
| 158 | |
| 159 | private: |
nothing calls this directly
no outgoing calls
no test coverage detected