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