I have two erlang nodes running in two different computers, in one node I have an ssl client and in the other i have the ssl server. Both computers are connected to the Internet via wifi connection.
Everything works right, but I wonder why if I switch off the wifi in the client laptop I don’t receive the {ssl_closed, Socket} message.
Socket options are:
{active, true}, {keepalive, true}
I mean, the socket should not be valid anymore..right?
The global TCP keepalive timeout value is typically set to a value like 7200 seconds between the keepalive messages. If you are on a Linux system you can check it with
sysctl -a | grep keepalive.Fiddling with this value is not really recommended since it is a global configuration. Instead you should add a
pingmessage to your application level protocol (letting the client send pings now and then), the server can simply discard it.It seems to be possible to set per-socket keepalive timeouts through the
inet:setopts/2function and using therawoption, but I don’t know if that is recommended (it’s not portable between platforms)