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