Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What logic is behind uv_is_readable/writable applicable to tcp sockets? #1798

Open
OleksandrKvl opened this issue Apr 16, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@OleksandrKvl
Copy link

commented Apr 16, 2018

  • Version: 1.15
  • Platform: windows, unix(android)

Hi, I observe behavior that looks confusing to me with these functions.

  1. On windows when connection has been reset by remote side, in read callback that got error socket still remains readable and writable. But obviously we can do nothing else with it except close.

  2. On windows immediately after uv_shutdown(), socket becomes not writable.
    But on unix(in my case it was Android, but source file for that is the same) after uv_shutdown(), it's still writable.

I check latest source files and have not found any changes related to those flags.

@bnoordhuis

This comment has been minimized.

Copy link
Member

commented Apr 16, 2018

On windows when connection has been reset by remote side, in read callback that got error socket still remains readable and writable.

A borderline bug. You're supposed to close it on error (as you say), you wouldn't try to read or write.

On windows immediately after uv_shutdown(), socket becomes not writable. But on unix [..] after uv_shutdown(), it's still writable.

I'd say that's a UNIX bug. The Windows behavior is correct.

Pull requests welcome, of course.

@OleksandrKvl

This comment has been minimized.

Copy link
Author

commented Apr 17, 2018

Will try to fix it, I've already created test and fix for 2 problem, hope I will have a time to work on 1 today.

Updated.
However, is it possible to write test for the 1 case? libuv cannot RST connections.

@OleksandrKvl OleksandrKvl referenced a pull request that will close this issue Apr 27, 2018

Open

Readable/writable states fixes #1825

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.