void socket_close( DPS_CONN *connp ){ if (!connp) return; if (connp->conn_fd > 0){ dps_closesocket(connp->conn_fd); connp->conn_fd = 0; } return; }
void DpsSearchdClose(DPS_DB *cl) { DPS_SEARCHD_PACKET_HEADER hdr; ssize_t nsent; if(cl->searchd > 0) { /* Send goodbye */ hdr.cmd = DPS_SEARCHD_CMD_GOODBYE; hdr.len = 0; nsent = DpsSearchdSendPacket(cl->searchd, &hdr, NULL); dps_closesocket(cl->searchd); cl->searchd = 0; } }