
I have an ASIO socket server. I need to close the socket and then listen to the socket again if client disconnected from server. When the server was started, the socket and acceptor are initialized like this: asio_socketPtr = new tcp::socket(asio_service); asio_acceptorPtr = new tcp::acceptor(asio_service, tcp::endpoint(protocol, m_iPort)); in the process closing the socket, I did the following in order: asio_acceptorPtr->close(error_closing); asio_socketPtr->shutdown(tcp::socket::shutdown_both, error_closing); asio_socketPtr->close(error_closing); in the process reopen the socket, I did the following in order: asio_socketPtr->open(protocol, error_connecting); asio_acceptorPtr->open(protocol, error_connecting); but I always got error. the error code is 1. It means Operation not permitted. Did I miss something? Do I need to delete above socketPtr and acceptorPtr and create new one each time? thanks, -- View this message in context: http://www.nabble.com/socket-reconnection-tp20922241p20922241.html Sent from the Boost - Users mailing list archive at Nabble.com.