| 167 | } |
| 168 | |
| 169 | bool ICMP_Session::Ping::IsInitialised() const |
| 170 | { |
| 171 | #ifdef _WIN32 |
| 172 | return icmpFile != INVALID_HANDLE_VALUE; |
| 173 | #else |
| 174 | switch (icmpConnectionKind) |
| 175 | { |
| 176 | case (PingType::ICMP): |
| 177 | case (PingType::RAW): |
| 178 | return icmpSocket != -1; |
| 179 | default: |
| 180 | return false; |
| 181 | } |
| 182 | #endif |
| 183 | } |
| 184 | |
| 185 | // Returned PingResult.data is only valid when PingResult.type is 0 |
| 186 | ICMP_Session::PingResult* ICMP_Session::Ping::Recv() |