Overhaul socket
stubs on Windows and MacOS
#8106
Merged
socket
stubs on Windows and MacOS
#8106