Path: utzoo!attcan!uunet!decwrl!ucbvax!daahoud.UUCP!hwajin From: hwajin@daahoud.UUCP Newsgroups: comp.protocols.tcp-ip Subject: Re: timimg-out a socket read Message-ID: <9006260012.AA29729@daahoud.> Date: 26 Jun 90 00:12:44 GMT References: Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 23 > I am trying to use tcp-ip for real-time application. The application > consists of a client in the field that collects real-time data every > two seconds and sends it to the server which stores it in the database. > (A host of application programs use this data for different purpose.) > The specification requires that if no data is received within 15 seconds, > I declare the real-time data channel dead. actually, if this is the only requirement, more precise way of handling this situation would be to have your application perform non-blocking (or asynchronous) i/o on connected data channel and keep your own application level timer. when your timer expires (say, SIGALARM goes off and your signal handler is called) you can close and shutdown the connection, or just mark it dead and move onto something else. in certain implementations (like bsd 4.3 unix) of tcp, users can specify a keep_alive option on the connected socket which is used to detect a dead connection, which works for most applications. the time it takes to detect a dead connection is not easily settable by the users, and certainly not settable per connection basis (e.g. you need to modify the values of global variables in your unix kernel -- tcp_keepidle, tcp_keepintvl, and tcp_maxidle in 4.3 bsd tahoe release of tcp/ip, which will affect all of the tcp based applications running on that version of the kernel). this keep_alive is *not* a standard specified in the rfc; it's just an implementation specific feature.