Hello I was wonder if its possible to create synchronous behaviour regarding a connection attempt, i.e. Upper library layer calls : connect to host and waits for the connection to succeed or time out. asio can create the async connection attempt and timer and then run the ioservice to 'wait' on the async calls. which is fine in a simple senario where there are no other async calls running, ideally i'd like to be able to bring up a connection in a synchronous manner and then introduce the socket into an io_service which is processed by a pool of threads. Is it possible to either change the io_service a tcp socket uses, or retrieve the native type in a tcp socket and release the objects ownership of the type and assign this to a new object which uses the other io_service? i.e. Thread local io_service for setup library io_service which is processed by threadpool ? Thanks, Ian.
On Tue, Jun 24, 2008 at 1:35 AM, Ian O'Connell
Hello
I was wonder if its possible to create synchronous behaviour regarding a connection attempt, i.e.
Upper library layer calls : connect to host and waits for the connection to succeed or time out. asio can create the async connection attempt and timer and then run the ioservice to 'wait' on the async calls.
which is fine in a simple senario where there are no other async calls running, ideally i'd like to be able to bring up a connection in a synchronous manner and then introduce the socket into an io_service which is processed by a pool of threads.
Is it possible to either change the io_service a tcp socket uses, or retrieve the native type in a tcp socket and release the objects ownership of the type and assign this to a new object which uses the other io_service?
i.e. Thread local io_service for setup library io_service which is processed by threadpool
I can't speak for other platforms but at least on Windows this is impossible with the API that asio uses. -- Cory Nelson
participants (2)
-
Cory Nelson
-
Ian O'Connell