You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a legacy across-platform app, which uses another socket library for the network communication. Since code bases are huge, it may not be able to be rewritten completely with asio.
But I want to change at least the thread model of the app by using asio async_wait functions for the event driven thread model. I have tried the stream_posix_descriptor and works great on the macOS. It takes over the socket fd from current socket library, and assign to an asio stream_posix_descriptor for async_wait, and then release the fd, and current socket library read/write bytes on socket without block. It fits for all kinds of sockets, server_socket for accept, stream_socket for send/receive, even datagram_socket amazingly.
But luck does not come to Windows, firstly the posix_descriptor seems excluded from all Windows platform apps in some purpose, I could tell from the ASIO_HAS_POSIX_STREAM_DESCRIPTOR definition. What is Windows equivalent asio wait-able object ?
And secondly, the ip::tcp::stream_socket accepted from an ip::tcp::acceptor often return failure in the release function with ec of "operation_not_supported", and then socket operations (send/recv) are failed on it when the socket remain as open and connected. The problem comes from below after NtSetInformationFile windows API call. I have not yet found a client stream socket has the similar issue yet.
I have a legacy across-platform app, which uses another socket library for the network communication. Since code bases are huge, it may not be able to be rewritten completely with asio.
But I want to change at least the thread model of the app by using asio async_wait functions for the event driven thread model. I have tried the stream_posix_descriptor and works great on the macOS. It takes over the socket fd from current socket library, and assign to an asio stream_posix_descriptor for async_wait, and then release the fd, and current socket library read/write bytes on socket without block. It fits for all kinds of sockets, server_socket for accept, stream_socket for send/receive, even datagram_socket amazingly.
But luck does not come to Windows, firstly the posix_descriptor seems excluded from all Windows platform apps in some purpose, I could tell from the ASIO_HAS_POSIX_STREAM_DESCRIPTOR definition. What is Windows equivalent asio wait-able object ?
And secondly, the ip::tcp::stream_socket accepted from an ip::tcp::acceptor often return failure in the release function with ec of "operation_not_supported", and then socket operations (send/recv) are failed on it when the socket remain as open and connected. The problem comes from below after NtSetInformationFile windows API call. I have not yet found a client stream socket has the similar issue yet.
Anyone has any clue and how to workaround with this? I am using the latest stable release version of Asio version 1.30.2 .
The text was updated successfully, but these errors were encountered: