Topic: asio, tcp socket, async_connect () and ' connection timed out ' later 5 minutes
Greetings! I am connected to some server which "does not listen" at present to port, and I receive connection timed out later 5 minutes. Baffles that it is necessary to wait already five minutes. In Google there are decisions on socket transfer in a non-blocking mode, but for this purpose it is necessary to have a socket descriptor. But boost:: asio:: ip:: tcp:: socket receives a descriptor only after a connection. I.e. this code will not work until will be connected: boost:: asio:: ip:: tcp:: socket socket (io_service); boost::asio::socket_base::non_blocking_io command (true); socket.io_control (command); there is still a variant to create a socket descriptor with the help int s =:: socket (...); and to transfer it in , but it is somehow ugly... There are ideas? Thanks.