Skip to content

Commit

Permalink
uv-win: allow listen on unbound tcp handle
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryRawas authored and piscisaureus committed Jul 15, 2011
1 parent 7b46073 commit d540872
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/uv-win.c
Expand Up @@ -1125,6 +1125,10 @@ int uv_tcp_listen(uv_tcp_t* handle, int backlog, uv_connection_cb cb) {
return -1;
}

if (!(handle->flags & UV_HANDLE_BOUND) &&
uv_tcp_bind(handle, uv_addr_ip4_any_) < 0)
return -1;

if (listen(handle->socket, backlog) == SOCKET_ERROR) {
uv_set_sys_error(WSAGetLastError());
return -1;
Expand Down

0 comments on commit d540872

Please sign in to comment.