diff --git a/src/libstd/sys/windows/net.rs b/src/libstd/sys/windows/net.rs index 32f4011fb32..2f2f285edc1 100644 --- a/src/libstd/sys/windows/net.rs +++ b/src/libstd/sys/windows/net.rs @@ -100,7 +100,7 @@ pub fn new(addr: &SocketAddr, ty: c_int) -> io::Result { c::WSA_FLAG_OVERLAPPED | c::WSA_FLAG_NO_HANDLE_INHERIT) { c::INVALID_SOCKET => { match c::WSAGetLastError() { - c::WSAEPROTOTYPE => { + c::WSAEPROTOTYPE | c::WSAEINVAL => { match c::WSASocketW(fam, ty, 0, ptr::null_mut(), 0, c::WSA_FLAG_OVERLAPPED) { c::INVALID_SOCKET => Err(last_error()), @@ -199,7 +199,7 @@ pub fn duplicate(&self) -> io::Result { c::WSA_FLAG_OVERLAPPED | c::WSA_FLAG_NO_HANDLE_INHERIT) { c::INVALID_SOCKET => { match c::WSAGetLastError() { - c::WSAEPROTOTYPE => { + c::WSAEPROTOTYPE | c::WSAEINVAL => { match c::WSASocketW(info.iAddressFamily, info.iSocketType, info.iProtocol,