Re: Keep alive

kjpou <[email protected]>
Newsgroups gmane.comp.emulators.tn5250
Message-ID <[email protected]>
Scott and James

If I may be of service on this one.  I sincerely apologize if this is 
inappropriate for me responding here.

The socket options for keep alive do not work in this situation.  Client 
access uses the timing marks from everything I was able to figure out.  
Never could figure out how though.  After a couple of days of sniffing 
and parameter negotiation tweaking I just gave up and said I would come 
back to it later.  That never happened.

Without mucking up the connection you can use an "Are You There" by 
sending the following at an interval of no activity:

byte[] b = { (byte) 0xff, (byte) 0xf1 };

This is just a NOP instruction from the rfc 854

NOP                 241    No operation.

The rfc specifies 0xF6

Are You There       246    The function AYT.

But the NOOP seemed safer to me and worked.

Hope this helps.

Regards

Kenneth


Scott Klement wrote:
> James,
>
> setsockopt() should have an option called SO_KEEPALIVE to enable 
> keepalives at the TCP level.  Is this really what Mark is looking for, 
> though?   I mean, I know they have the same name -- but are they the 
> same thing?
>
> Seems to me that TCP keepalives are really intended for detection of 
> broken connetions, and aren't sent often enough to keep a telnet alive.
>
> Telnet (RFC 854) also defines an "Are You There" (AYT) code that can be 
> sent periodically to verify that a telnet session is still active -- and 
> there's also an extension to telnet (RFC 860) for timing marks, which 
> has a similar purpose AFIAK.
>
> I'd be nervous about trying to implement any of these without first 
> determining what exactly the other emulators send when they're trying to 
> keep the connection active....
>
>
> James Rich wrote:
>   
>> Interesting to note that I usually have the exact reverse problem: 
>> Windows Client Access sessions drop but tn5250 marches on perfectly.
>>
>> In linux there are three tcp keepalive settings:  tcp_keepalive_intvl, 
>> tcp_keepalive_probes, and tcp_keepalive_time in /proc/sys/net/ipv4 (at 
>> least there are on kernel 2.6.24.5).  Might these be something like what 
>> you are looking for?  I thought I remembered seeing an option to 
>> setsockopt that would set the tcp keepalive per socket but a quick review 
>> of the man page turns up nothing (other than referencing the /proc 
>> settings I listed above).
>>
>> James Rich
>>
>> if you want to understand why that is, there are many good books on
>> the design of operating systems. please pass them along to redmond
>> when you're done reading them :)
>>  	- Paul Davis on ardour-dev
>>     
>
>   
-- 
This is the Linux 5250 Development Project (LINUX5250) mailing list
To post a message email: LINUX5250-Zwy7GipZuJhWk0Htik3J/[email protected]
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/linux5250
or email: LINUX5250-request-Zwy7GipZuJhWk0Htik3J/[email protected]
Before posting, please take a moment to review the archives
at http://archive.midrange.com/linux5250.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.