Not getting tcp_closed

Writing a tcp client using gen_tcp in gen_server, so after connecting successfully(using gen_tcp:connect) I am trying to send my tcp server out of reach(disconnecting network from tcp server) and expecting some event at my gen_server handle_info but I am not getting anything.

please help, how it can be achieved ?

Try to turn on Keep-Alive with inet:setopts(Socket, [{keep_alive, true}]). TCP runs on top of a connection-less protocol (IP), so without periodically checking that the remote is side is there, it might not notice that the remote server is gone.