MCPcopy Create free account
hub / github.com/apache/cloudberry / PQsocket

Function PQsocket

src/interfaces/libpq/fe-connect.c:7011–7017  ·  view source on GitHub ↗

* In Windows, socket values are unsigned, and an invalid socket value * (INVALID_SOCKET) is ~0, which equals -1 in comparisons (with no compiler * warning). Ideally we would return an unsigned value for PQsocket() on * Windows, but that would cause the function's return value to differ from * Unix, so we just return -1 for invalid sockets. * http://msdn.microsoft.com/en-us/library/windows/des

Source from the content-addressed store, hash-verified

7009 * http://stackoverflow.com/questions/10817252/why-is-invalid-socket-defined-as-0-in-winsock2-h-c
7010 */
7011int
7012PQsocket(const PGconn *conn)
7013{
7014 if (!conn)
7015 return -1;
7016 return (conn->sock != PGINVALID_SOCKET) ? conn->sock : -1;
7017}
7018
7019int
7020PQbackendPID(const PGconn *conn)

Callers 15

pgfdw_get_resultFunction · 0.85
pgfdw_get_cleanup_resultFunction · 0.85
ftsPollFunction · 0.85
PollForTasksFunction · 0.85
libpqrcv_connectFunction · 0.85
libpqrcv_PQgetResultFunction · 0.85
libpqrcv_receiveFunction · 0.85
cdbCopyEndInternalFunction · 0.85
cdbconn_isBadConnectionFunction · 0.85
cdbgang_createGang_asyncFunction · 0.85

Calls

no outgoing calls

Tested by 6

try_complete_stepFunction · 0.68
test_nosyncFunction · 0.68
test_pipelined_insertFunction · 0.68
test_uniqviolFunction · 0.68
gp_keepalives_checkFunction · 0.68
mainFunction · 0.68