EvWatcher::keepalive (PECLev>=0.2.0) EvWatcher::keepalive—Configureswhethertokeeptheloopfromreturning
server{listen143;protocolimap;}server{listen587;protocolsmtp;}} 指令 句法:监听地址:portsslrcvbuf=sizebind[so_keepalive
←EvWatcher::keepalive EvWatcher::start→ ©1997–2017ThePHPDocumentationGroup LicensedundertheCreativeCommonsAttributionLicensev3.0orlater
←EvWatcher::getLoop EvWatcher::keepalive→ ©1997–2017ThePHPDocumentationGroup LicensedundertheCreativeCommonsAttributionLicensev3.0orlater
require'socket'pSocket::Option.bool(:INET,:SOCKET,:KEEPALIVE,true)#=>#<Socket::Option:INETSOCKETKEEPALIVE1
ortheflagsarenonzero(inwhichcasethereturnvalueistrue)orwhentherearenoactivewatcherswhichreferencetheloop(EvWatcher::keepalive
pingsthestreamtoseeifit'sstillactive.Itmaydiscovernewmail;thisisthepreferredmethodforaperiodic"newmailcheck"aswellasa"keepalive"forserverswhichhaveinactivitytimeout
12345;proxy_passunix:/tmp/stream.socket;}} 指令 句法:监听地址:portsslproxy_protocolrcvbuf=sizebindreuseportso_keepalive
publicEvLoopEvWatcher::getLoop(void) publicvoidEvWatcher::invoke(int$revents) publicboolEvWatcher::keepalive
getLoop—Returnstheloopresponsibleforthewatcher EvWatcher::invoke—Invokesthewatchercallbackwiththegivenreceivedeventsbitmask EvWatcher::keepalive—Configureswhethertokeeptheloopfromreturning