| 214 | } |
| 215 | |
| 216 | struct addrinfo* pickAddressByProtocol(struct addrinfo* addr, int protocol) |
| 217 | { |
| 218 | for (; addr != NULL; addr = addr->ai_next) |
| 219 | { |
| 220 | if (addr->ai_family == protocol) |
| 221 | return addr; |
| 222 | } |
| 223 | |
| 224 | return NULL; |
| 225 | } |
| 226 | |
| 227 | /// Extracts core address parts from an address string. Returns false if it's malformed. |
| 228 | bool extractAddressParts(const char *addressString, char outAddress[256], int &outPort, int &outFamily) |