<div dir="ltr"><div><div><div><div>Hi, <br><br></div>Here is a question about why I sometimes get an etimedout error from gen_tcp:recv.<br><br></div>I open a tcp socket on the server side using lines like:<br><br>{ok, LSock} = gen_tcp:listen(Port, [binary, {packet, line}, {active, false}]),<br>
{ok, Sock} = gen_tcp:accept(LSock),<br></div>do_recv(Sock).<br><br><br></div>where do_recv is something like this:<br><br><br><div><div>do_recv(Sock) -><br> case gen_tcp:recv(Sock, 0) of<br> {ok, Data} -><br>
<br> do_recv(Sock); <br><br> {error, Reason} -><br> ?DAWN_EVENT("tcp_bus got error and shut down: ~p", [Reason]),<br> telnet_subscriber:unsubscribe({Sock, self()})<br> end.<br>
<br></div></div></div>