From: Yohanes Santoso Date: 2007-11-12T23:17:45+09:00 Subject: Re: Socket timeout Lee Jarvis writes: Q> Francis Cianfrocca wrote: >> What do you mean by "the connection times out"? Do you mean that the >> connection has no read or write activity for some interval of time? > Yes, basically You can adjust the SO_RCVTIMEO and SO_SNDTIMEO socket options using Socket#{get,set}sockopts. However, they are susceptible to trickle attack. For example, if you set the receive timeout to 30 seconds, then the sender can send just one packet every 30 seconds, tying up resources on your end. The proper solution requires application-level enforcement of timeout. You can use the timeout library for the least invasive mechanism to even changing the core mechanism to Ruby/EventMachine. YS. > > >> If you need to do that, then the Ruby/EventMachine library has that >> ability. >> You'll need to rearrange your code to go this route, so perhaps someone >> else >> will have a less invasive solution. If not, then look at EventMachine. > > Uh, I am editing an old program of mine which is quite large, about > 1.4k+ lines, so I am trying to do it the least invasive way possible.. I > appreciate your input so quickly though. Perhaps this is the only route. > > Lee > -- > Posted via http://www.ruby-forum.com/.