Does EM handle keep alives automatically ? Or do I need to send them my self ? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/eventmachine-talk/attachments/20070305/f811c898/attachment.html
On 3/5/07, Daniel Aquino <mr.danielaquino at gmail.com> wrote:> > Does EM handle keep alives automatically ? > Or do I need to send them my self ?What do you mean by a "keepalive"? The TCP keepalive? No, EM doesn''t do that. Some protocol-level keepalive? No, that would depend on the protocol, and you''d have to implement it in your handler. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/eventmachine-talk/attachments/20070305/54da93cf/attachment.html
Could EM allow you to set Socket::SO_KEEPALIVE? (or other socket options) - Tony On 3/5/07, Francis Cianfrocca <garbagecat10 at gmail.com> wrote:> > On 3/5/07, Daniel Aquino <mr.danielaquino at gmail.com> wrote: > > > > Does EM handle keep alives automatically ? > > Or do I need to send them my self ? > > > > What do you mean by a "keepalive"? The TCP keepalive? No, EM doesn''t do > that. Some protocol-level keepalive? No, that would depend on the protocol, > and you''d have to implement it in your handler. > > > _______________________________________________ > Eventmachine-talk mailing list > Eventmachine-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/eventmachine-talk >-- Tony Arcieri ClickCaster, Inc. tony at clickcaster.com (970) 232-4208 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/eventmachine-talk/attachments/20070305/6351794e/attachment.html
On 3/6/07, Tony Arcieri <tony at clickcaster.com> wrote:> > Could EM allow you to set Socket::SO_KEEPALIVE? (or other socket options)Potentially yes, but why would you ever want to set SO_KEEPALIVE? I can see being able to set some of the other options (like the kernel-buffer sizes), but you have to know what you''re doing to use those, otherwise you might drop your app''s performance like crazy. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/eventmachine-talk/attachments/20070306/1438988e/attachment.html
So basically your saying if I better send a packet at least every 30 seconds or so ... other wise my connection might die right? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/eventmachine-talk/attachments/20070306/1818b01f/attachment.html
On 3/6/07, Daniel Aquino <mr.danielaquino at gmail.com> wrote:> > So basically your saying if I better send a packet at least every 30 > seconds or so ... other wise my connection might die right?Well, no. Whether such a thing is required depends on the app-level protocol. EM won''t time out your connections automatically unless you call EventMachine::Connection#set_inactivity_timeout. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/eventmachine-talk/attachments/20070306/060f9b0c/attachment.html
On 3/6/07, Francis Cianfrocca <garbagecat10 at gmail.com> wrote:> On 3/6/07, Daniel Aquino <mr.danielaquino at gmail.com> wrote: > > So basically your saying if I better send a packet at least every 30 > seconds or so ... other wise my connection might die right? > > > Well, no. Whether such a thing is required depends on the app-level > protocol. EM won''t time out your connections automatically unless you call > EventMachine::Connection#set_inactivity_timeout.It also depends on whether there''s some sort of NAT gateway (e.g. home firewall) in between the client and the server which reaps idle connections. If such is the case, it is the client''s responsibility to send an application-level heartbeat to keep the connection established. Best regards, --Michael
On 3/6/07, Michael S. Fischer <michael at dynamine.net> wrote:> > > It also depends on whether there''s some sort of NAT gateway (e.g. home > firewall) in between the client and the server which reaps idle > connections. If such is the case, it is the client''s responsibility > to send an application-level heartbeat to keep the connection > established.Certainly. But in that case the heartbeat has to be something that makes sense in the application-level protocol. You can''t just send a zero-length packet because that''s not allowed in TCP. (And in UDP, where it is allowed, there''s no need for keepalive.) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/eventmachine-talk/attachments/20070306/e4eeffa1/attachment.html
Well doesn''t TCP at the OS layer it self have a TimeOut setting? P.S. Do you guys know how to stop gmail from appending what you just said underneath my reply?!!? On 3/6/07, Francis Cianfrocca <garbagecat10 at gmail.com> wrote:> > On 3/6/07, Michael S. Fischer <michael at dynamine.net> wrote: > > > > > > It also depends on whether there''s some sort of NAT gateway (e.g. home > > firewall) in between the client and the server which reaps idle > > connections. If such is the case, it is the client''s responsibility > > to send an application-level heartbeat to keep the connection > > established. > > > > Certainly. But in that case the heartbeat has to be something that makes > sense in the application-level protocol. You can''t just send a zero-length > packet because that''s not allowed in TCP. (And in UDP, where it is allowed, > there''s no need for keepalive.) > > > _______________________________________________ > Eventmachine-talk mailing list > Eventmachine-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/eventmachine-talk >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/eventmachine-talk/attachments/20070306/4a5b1724/attachment-0001.html
On 3/6/07, Daniel Aquino <mr.danielaquino at gmail.com> wrote:> > Well doesn''t TCP at the OS layer it self have a TimeOut setting?There is a TCP keepalive but it''s very controversial and probably shouldn''t be used. And in any case, it fires every 75 minutes, probably not helpful for keeping a firewall from timing out your connections. Exactly what situation do you need to solve? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/eventmachine-talk/attachments/20070306/656d0af2/attachment.html