trifork / erjang

A JVM-based Erlang VM
http://www.erjang.org
Apache License 2.0
726 stars 62 forks source link

tcp recv() does not honour timeout #37

Closed eriksoe closed 14 years ago

eriksoe commented 14 years ago

== To reproduce: {ok, P} = gen_tcp:listen(12321, [binary, {active,false}]). {ok,Q} = gen_tcp:accept(P). %% telnet to localhost:12321 at this point; don't send anything. gen_tcp:recv(Q, 0, 250). %% wait for 1 second

== Expected behaviour: The result {error,timeout} after 250ms

== Observed behaviour: Timeout is not in effect. Erjang waits for input on the socket. Closing the connection from the telnet side doesn't even make recv() return.

krestenkrab commented 14 years ago

Fixed in https://github.com/krestenkrab/erjang/commit/f3119af179830673e98c53317bf157e2e131a8af. Main-loop was not triggered to be re-run when making synchronous driver invocation erlang:port_control/3. This caused modified timer to not be recognized.