You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 4, 2018. It is now read-only.
Hi, let me explain this strange case with pseudo-code:
addr = 127.0.0.1:9999
# Nothing is listening in 127.0.0.1:9999 so ECONNREFUSED should occur.
uv_tcp_connect(connect_req, handle, addr, connect_cb);
# Right now attempt to write:
uv_write(write_req, handle, "HELLO", write_cb);
So the result of this code is that connect_cb() is called with status=0 (so connected), then write_cb() is called with error ECONNREFUSED, and then connect_cb() is called again with error EOF.
So, what I think is that the connection was established but inmediately disconnected by the peer, which is not true!
Thus my basic question is: is the above code wrong? is it valid (in UV land) to attemp to write in a TCP handle before it's connected? Why does the above code call to connect_cb() with status 0?
The text was updated successfully, but these errors were encountered:
Hi, I've tryed to add a test unit showing this but I get some ugly error during the test execution. Anyhow I've added some printf which demostrate the issue.
(Linux)
Hi, let me explain this strange case with pseudo-code:
So the result of this code is that
connect_cb()
is called with status=0 (so connected), thenwrite_cb()
is called with error ECONNREFUSED, and thenconnect_cb()
is called again with error EOF.So, what I think is that the connection was established but inmediately disconnected by the peer, which is not true!
Thus my basic question is: is the above code wrong? is it valid (in UV land) to attemp to write in a TCP handle before it's connected? Why does the above code call to
connect_cb()
with status 0?The text was updated successfully, but these errors were encountered: