forked from libuv/libuv
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
win: allow bound/connected socket in uv_tcp_open()
On Unix you can pass bound and even connected socket to uv_tcp_open and it will work as expected: you can run uv_listen or other io functions (uv_read, uv_write) on it without problems. On windows on the other hand the function always assumes to have clean socket and for example uv_listen will try to bind it again, and uv_read/write will return with errors about unreadable streams (basically invalid internal flags). To check if socket is already bound uv_tcp_getsockname is called which on windows returns error when socket is unbound. To further differentiate connected one from just bound, uv_tcp_getpeername also returns error but when target socket is not connected. PR-URL: libuv#1447 Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
- Loading branch information
1 parent
371ca6d
commit 6827fa3
Showing
3 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters