-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
error UDP socket #26518
Comments
@dev-priporov could you run your program with 10022 error code in Windows means invalid argument; I can’t tell you what’s the reason for 2nd variant, but at least it is not the standard library using |
#[test]
fn foo(){
let socket = UdpSocket::bind("127.0.0.1:5001").ok().expect("fail bind");;//.expect("fail bind");
} $cargo test result: Compiling main v0.1.0 (file:///D:/Documents/Rust/udp/main) running 1 test failures: ---- foo stdout ---- |
start main.exe with RUST_BACKTRACE=1 $D:\Documents\Rust\udp>main.exe uild/src/libcore\option.rs:330 stack backtrace: 1: 0x447e9f - main 2: 0x40a9bc - main 3: 0x40b3df - main 4: 0x447900 - main 5: 0x4623f8 - main 6: 0x40492f 7: 0x404560 8: 0x44aa7c - main 9: 0x406827 - main 10: 0x4013de 11: 0x77071174 - BaseThreadInitThunk 12: 0x7737b3f5 - RtlInitializeExceptionChain |
up |
Do you have SP1 installed? If not, it's most likely #26658. |
Triage: it's been a long time, and with no response about SP1, I'm going to give this a close. @dev-priporov if you're still seeing this today, please let me know and we can re-open. |
std:win: avoid WSA_FLAG_NO_INHERIT flag and don't use SetHandleInformation on UWP This flag is not supported on Windows 7 before SP1, and on windows server 2008 SP2. This breaks Socket creation & duplication. This was fixed in a previous PR. cc #26658 This PR: cc #60260 reuses this flag to support UWP, and makes an attempt to handle the potential error. This version still fails to create a socket, as the error returned by WSA on this case is WSAEINVAL (invalid argument). and not WSAEPROTOTYPE. MSDN page for WSASocketW (that states the platform support for WSA_FLAG_NO_HANDLE_INHERIT): https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsasocketw CC #26543 CC #26518
I have that code:
and I start it in 2 different PC with OS win7 32 , and have 2 different error:
1)thread '' panicked at 'called Result::unwrap() on an Err value: Error { repr: Os(10022) }',
C:/bot/slave/stable-dist-rustc-win-32/build/src/libcore\result.rs:729
2)thread '' panicked at 'fail bind', C:/bot/slave/stable-dist-rustc-win-32/b
uild/src/libcore\option.rs:330
This errors com in after first string:
The text was updated successfully, but these errors were encountered: