Article delegate-en/2646 of [1-5169] on the server localhost:119
  upper oldest olders older1 this newer1 newers latest
search
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
[Reference:<_A2632@delegate-en.ML_>]
Newsgroups: mail-lists.delegate-en

[DeleGate-En] Re: fake activity of an idle connection
12 Jun 2004 03:55:48 GMT feedback@delegate.org (Yutaka Sato)
The DeleGate Project


On 06/04/04(04:21) you Travice Dane <nycstealth2002@yahoo..> wrote
in <_A2632@delegate-en.ML_>
 |We use delegate to proxy ssl encrypted telnet connections from our external clients to a telnet server inside. Everything works just fine. Unfortunately, those connections can remain inactive (idle) for a quite long period of time. Because some of our clients have outbound firewalls with connection idle timeout, an inactive connection gets killed. I'm wondering, is any way to make delegate to create some fake activity to keep the connection alive?

DeleGate sets SO_KEEPALIVE for both of client-side and server-side
connections at the start.  If a client can control the interval of
TCP level Keep-Alive packet (keep-alive probe) on his/her host, it
will solve the problem.

Another unexpected TCP disconnection can occur by the timeout of
idle connection by DeleGate itself.  It can be disabled with
TIMEOUT="idle:0" (the default value is 600 seconds).

For situations where these configurations are not effective, I can
introduce a mechanism to send out NOP command periodically on Telnet
connections with client and server, like the enclosed patch.
This patch is enabled with TIMEOUT="idle:0" option.

Cheers,
Yutaka
--
  D G   Yutaka Sato <y.sato@delegate.org> http://delegate.org/y.sato/
 ( - )  National Institute of Advanced Industrial Science and Technology
_<   >_ 1-1-4 Umezono, Tsukuba, Ibaraki, 305-8568 Japan
Do the more with the less -- B. Fuller


*** ../dist/delegate8.9.5/src/telnet.c	Mon Mar  8 17:33:27 2004
--- telnet.c	Sat Jun 12 12:47:10 2004
***************
*** 150,158 ****
--- 150,164 ----
  {	int cnt,rcc,ci,cj;
  	char *sdir;
  	int start,nready;
+ 	int keepalive;
  
  	rcc = 0;
  	start = time(0);
+ 	keepalive = 0;
+ 	if( timeout == 0 ){
+ 		keepalive = 1;
+ 		timeout = 60;
+ 	}
  	for( cnt = 0; cnt < 10; cnt++ ){
  		if( THREAD )
  			nready = thread_PollIn(sock,timeout*1000);
***************
*** 170,175 ****
--- 176,188 ----
  			break;
  		}
  		if( nready == 0 ){
+ 			if( keepalive ){
+ 				Verbose("%s generate NOP\n",what);
+ 				rcc = sizeof(NOPstr);
+ 				bcopy(NOPstr,buf,rcc);
+ 				break;
+ 			}
+ 
  			if( timeout <= time(0)-start ){
  				sv1log("Timedout %d sec. (by TIMEOUT=io:%ds)\n",
  					timeout,timeout);

  admin search upper oldest olders older1 this newer1 newers latest
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
@_@V