TCP socket KEEP-ALIVE

78 views
Skip to first unread message

frost...@gmail.com

unread,
Jul 14, 2014, 5:56:34 AM7/14/14
to action...@googlegroups.com
Hi guys,

Is there any option to enable keep-alive on tcp server?
socket.setKeepAlive([enable], [initialDelay])
Right now, on my server there are a lot of "ESTABLISHED" connections from users that are disconnected.

netstat -o

ESTABLISHED off (0.00/0/0)

Thanks

frost...@gmail.com

unread,
Jul 14, 2014, 9:27:21 AM7/14/14
to action...@googlegroups.com, frost...@gmail.com
Right now I'm getting a lot of established connections in actionhero, also tested with netstat because the connection is not closed ... somehow. All my connection are initiated from android and onPause() I disconnect from server. The problem, I think is when my clients are losing internet conection and I don;t send ... "exit" to tcp server.

please advice

Evan Tahler

unread,
Jul 15, 2014, 12:19:17 AM7/15/14
to action...@googlegroups.com, frost...@gmail.com
Give https://github.com/evantahler/actionhero/pull/420 a try.  I'll merge it if it works for you.
enabling keepAlive will never be enabled by default as this kind of thing is usually left up to the OS, and it will add overhead... but allowing for the option is OK! 

darer...@gmail.com

unread,
Jul 15, 2014, 1:25:25 AM7/15/14
to action...@googlegroups.com, frost...@gmail.com
thank you, it works
Reply all
Reply to author
Forward
0 new messages