Browse Source

Add hack to get error event on socket timeout

See
http://groups.google.com/group/nodejs/browse_thread/thread/4898a1ed3b99dcf0
v0.7.4-release
Ryan Dahl 15 years ago
parent
commit
c5b149ab1e
  1. 5
      deps/evcom/evcom.c

5
deps/evcom/evcom.c

@ -1018,6 +1018,11 @@ on_timeout (EV_P_ ev_timer *watcher, int revents)
if (stream->on_timeout) stream->on_timeout(stream);
// Hack to get error in Node on 'close' event.
// should probably be made into a proper error code.
stream->errorno = 1;
ev_timer_stop(EV_A_ watcher);
evcom_stream_force_close(stream);
if (stream->on_close) stream->on_close(stream);

Loading…
Cancel
Save