Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Now I have no clue how to include this in Perl program - do I have to write in event-driven manner or just collect state of socket in ordinary manner. I'd just like a program that will reconnect/maintain socket connection (with those socket options)and will not loose data sent to tcp connection - will continue only if write was succesful and rewrite on broken socket ...#KeepAlive<br> setsockopt($sck,SOL_SOCKET, SO_KEEPALIVE, pack("l", 1)); <br> #After 30 secs idle send KeepAlive probe<br> setsockopt($sck,IPPROTO_TCP,TCP_KEEPIDLE, pack("l", 30)); <br> #Rest probes after 30 secs.<br> setsockopt($sck,IPPROTO_TCP,TCP_KEEPINTVL,pack("l", 30)); <br><br>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: maintain tcp socket
by 5mi11er (Deacon) on Apr 12, 2005 at 15:37 UTC | |
by Anonymous Monk on Apr 12, 2005 at 16:00 UTC | |
by 5mi11er (Deacon) on Apr 12, 2005 at 16:35 UTC | |
|
Re: maintain tcp socket
by johnnywang (Priest) on Apr 12, 2005 at 17:25 UTC | |
by 5mi11er (Deacon) on Apr 13, 2005 at 15:24 UTC |