Hi Barry,
Thank you for reply.
I am little bit confused.
I saw the code for JDBC code and it sets true to
newStream.getSocket().setKeepAlive(requireTCPKeepAlive);
if ?tchKeepAlive=true is given.
But, in socket.c of odbc driver, in
char
SOCK_connect_to(SocketClass *self, unsigned short port, char *hostname, long timeout)
Can we just do the same thing?:
setsockopt(self->socket, IPPROTO_TCP, TCP_KEEPALIVE, (char *) &i, len);
as did in the same function:
if (setsockopt(self->socket, IPPROTO_TCP, TCP_NODELAY, (char *) &i, len) < 0) { SOCK_set_error(self, SOCKET_COULD_NOT_CONNECT, "Could not set socket to NODELAY."); closesocket(self->socket); self->socket = (SOCKETFD) -1; return 0; }
- Nachiket