
Hi, I'm having an issue starting then stopping and trying to restart a socket or rather the IOService that's being used to service that socket. The IOService and Socket are member's of my class that has a run method itself that is on a separate thread. In my class constructor the Socket is passed into the IOService constructor. The sequence is as follow's Socket.Open Socket.Bind Socket.async_recieve_from Thread Start ------ IOService.Run Socket.Close IOService.Stop ( the thread terminates due to the IOService.Run method completing ) Socket.Open Socket.Bind Socket.async_recieve_from Thread Start ------ IOService.Run This then return's immediately due to a "stopped" long in IOService ( on windows ) being set to 1. So my question is really am i trying to use these in the wrong way as in should i construct a new Socket and IOService for each time i want to start them or is there some way to reset the IOService to it's original state beyond calling IOService.Stop. Thanks, Tim.

On Mon, Oct 27, 2008 at 2:37 PM, Tim Pynegar
Hi,
I'm having an issue starting then stopping and trying to restart a socket or rather the IOService that's being used to service that socket.
The IOService and Socket are member's of my class that has a run method itself that is on a separate thread.
In my class constructor the Socket is passed into the IOService constructor.
The sequence is as follow's
Socket.Open Socket.Bind Socket.async_recieve_from
Thread Start ------
IOService.Run
Socket.Close
IOService.Stop ( the thread terminates due to the IOService.Run method completing )
Socket.Open Socket.Bind Socket.async_recieve_from
Thread Start ------
IOService.Run
This then return's immediately due to a "stopped" long in IOService ( on windows ) being set to 1.
So my question is really am i trying to use these in the wrong way as in should i construct a new Socket and IOService for each time i want to start them or is there some way to reset the IOService to it's original state beyond calling IOService.Stop.
Tim: See: http://www.boost.org/doc/libs/1_36_0/doc/html/boost_asio/reference/io_servic... -aps
participants (2)
-
Alexander Sack
-
Tim Pynegar