chriskohlhoff / asio

Asio C++ Library
http://think-async.com/Asio
4.72k stars 1.19k forks source link

Use WSAConnect when socket has been created by WSASocket #1445

Closed avsej closed 3 months ago

avsej commented 3 months ago

Otherwise it is possible that the ::connect() might return code

10038 An operation was attempted on something that is not a socket.

In particular it happens when trying to use ASIO inside Ruby native extension on Windows (which is using MinGW).

avsej commented 3 months ago

I will try to dig deeper and rather find the cause in this particular integration, because standalone test compiles with ASIO just fine. It should be something else, maybe Ruby intercepts some winsocks calls or something like that.