version 1.42, 2001/01/09 21:19:50 |
version 1.43, 2001/01/13 18:32:50 |
|
|
/* Informs that the current session is interactive. Sets IP flags for that. */ |
/* Informs that the current session is interactive. Sets IP flags for that. */ |
|
|
void |
void |
packet_set_interactive(int interactive, int keepalives) |
packet_set_interactive(int interactive) |
{ |
{ |
int on = 1; |
static int called = 0; |
|
if (called) |
|
return; |
|
called = 1; |
|
|
/* Record that we are in interactive mode. */ |
/* Record that we are in interactive mode. */ |
interactive_mode = interactive; |
interactive_mode = interactive; |
|
|
/* Only set socket options if using a socket. */ |
/* Only set socket options if using a socket. */ |
if (!packet_connection_is_on_socket()) |
if (!packet_connection_is_on_socket()) |
return; |
return; |
if (keepalives) { |
|
/* Set keepalives if requested. */ |
|
if (setsockopt(connection_in, SOL_SOCKET, SO_KEEPALIVE, (void *) &on, |
|
sizeof(on)) < 0) |
|
error("setsockopt SO_KEEPALIVE: %.100s", strerror(errno)); |
|
} |
|
/* |
/* |
* IPTOS_LOWDELAY and IPTOS_THROUGHPUT are IPv4 only |
* IPTOS_LOWDELAY and IPTOS_THROUGHPUT are IPv4 only |
*/ |
*/ |