- rGf8a74c18ec88: [lldb-server] Introduce Socket::Initialize and Terminate to simply WSASocket…
rLLDB358044: [lldb-server] Introduce Socket::Initialize and Terminate to simply WSASocket…
rL358044: [lldb-server] Introduce Socket::Initialize and Terminate to simply WSASocket…
Thank you for doing this. We probably should have done something like this a long time ago. I have a couple of inline comments, but they're all very trivial. Feel free to commit, if you agree with them.
I'd make this llvm::errorCodeToError(llvm::mapWindowsError(::WSAGetLastError())); as it's somewhat shorter and hopefully produces a better error message.
we don't use (void) in functions taking no arguments.
These calls should be roughly in dependency order. Since Sockets are in Host, I'd probably put this somewhere around the HostInfo::Initialize call on line 93. (same goes for the terminate call below)
ASSERT_THAT_ERROR(Socket::Initialize(), llvm::Succeeded()). That way, if this ever fails, you'll get the actual error message instead of "false is not true". (you might need to include something to have these available).