| 258 | } |
| 259 | |
| 260 | struct addrinfo* pickAddressByProtocol(struct addrinfo* addr, int protocol) |
| 261 | { |
| 262 | for (; addr != NULL; addr = addr->ai_next) |
| 263 | { |
| 264 | if (addr->ai_family == protocol) |
| 265 | return addr; |
| 266 | } |
| 267 | |
| 268 | return NULL; |
| 269 | } |
| 270 | |
| 271 | /// Extracts core address parts from an address string. Returns false if it's malformed. |
| 272 | bool extractAddressParts(const char *addressString, char outAddress[256], int &outPort, int &outFamily) |