| 349 | } |
| 350 | |
| 351 | static addrinfo* getAddressInfo (bool isDatagram, const String& hostName, int portNumber) |
| 352 | { |
| 353 | struct addrinfo hints; |
| 354 | zerostruct (hints); |
| 355 | |
| 356 | hints.ai_family = AF_UNSPEC; |
| 357 | hints.ai_socktype = isDatagram ? SOCK_DGRAM : SOCK_STREAM; |
| 358 | hints.ai_flags = AI_NUMERICSERV; |
| 359 | |
| 360 | struct addrinfo* info = nullptr; |
| 361 | |
| 362 | if (getaddrinfo (hostName.toRawUTF8(), String (portNumber).toRawUTF8(), &hints, &info) == 0) |
| 363 | return info; |
| 364 | |
| 365 | return nullptr; |
| 366 | } |
| 367 | |
| 368 | static bool connectSocket (std::atomic<int>& handle, |
| 369 | CriticalSection& readLock, |
no test coverage detected