MCPcopy Create free account
hub / github.com/crossuo/crossuo / icmp_open

Function icmp_open

src/Sockets.cpp:202–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200
201#if USE_PING
202icmp_handle icmp_open()
203{
204 socket_init();
205 auto h = ::socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
206 if (h == INVALID_SOCKET)
207 return nullptr;
208
209 if (h == SOCKET_ERROR)
210 return nullptr;
211
212 auto *s = new SOCKET;
213 *s = h;
214 return (icmp_handle)s;
215}
216
217int icmp_query(icmp_handle handle, const char *ip, uint32_t *timems)
218{

Callers 1

CalculatePingMethod · 0.85

Calls 1

socket_initFunction · 0.85

Tested by

no test coverage detected