MCPcopy Create free account
hub / github.com/apache/kvrocks / IsPortInUse

Function IsPortInUse

src/common/io_util.cc:366–370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

364}
365
366bool IsPortInUse(uint32_t port) {
367 auto s = SockConnect("0.0.0.0", port);
368 if (s) close(*s);
369 return s.IsOK();
370}
371
372/* Wait for milliseconds until the given file descriptor becomes
373 * writable/readable/exception */

Callers 1

mainFunction · 0.85

Calls 2

SockConnectFunction · 0.85
IsOKMethod · 0.45

Tested by

no test coverage detected