I am implementing a TCP server in Erlang that speaks with mobile phone clients. Mobile phones often go offline, so the server should be able to detect it. Therefore, I want the server to send messages to clients with a timeout, so when the timeout is closed, the connection is closed and the client is disconnected.
I used this listening function on the server:
[{certfile, "cert.pem"}, {keyfile, "key.pem"}, {reuseaddr, true}, {active, false}, {send_timeout, 10000}]
After I established the connection between the server and the mobile phone, I switch the phone to airplane mode (which disables all wireless signals) and performs ssl: send on the server. The happliy send function returned normally, as if the packet was successfully transmitted.
What did I do wrong?
source share