Error closing an asio::socket

Hello. In a program server in c++ I create an asio::socket and I listen it on a port (myPortNumber). Then I connect to my program using telnet (linux) with: telnet localhost myPortNumber The communication works fine, except that when I close the terminal window, the server closes with an error message: "terminate called without an active exception Aborted Process returned 134 (0x86)" Why? How can I prevent the server program is interrupted? -- View this message in context: http://boost.2283326.n4.nabble.com/Error-closing-an-asio-socket-tp3521153p35... Sent from the Boost - Users mailing list archive at Nabble.com.

I noticed that if I use telnet from the new terminal in Ubuntu 4.11 (Byobu) I do not have this problem ... -- View this message in context: http://boost.2283326.n4.nabble.com/Error-closing-an-asio-socket-tp3521153p35... Sent from the Boost - Users mailing list archive at Nabble.com.

Claude wrote:
The communication works fine, except that when I close the terminal window, the server closes with an error message:
"terminate called without an active exception Aborted
Process returned 134 (0x86)"
Can you provide a simple cut down version of your server code that exhibits the problem you mention?

This is the code: boost::asio::io_service io_service; tcp::acceptor acceptor(io_service,tcp::endpoint(tcp::v4(),3211)); while(1) { tcp::socket *socket = new tcp::socket(io_service); // acceptor.accept(*socket); //make a new thread... std::thread *t = new std::thread(std::bind(threadSocket,socket)); }//endwhile -- View this message in context: http://boost.2283326.n4.nabble.com/Error-closing-an-asio-socket-tp3521153p35... Sent from the Boost - Users mailing list archive at Nabble.com.
participants (2)
-
Arash Partow
-
Claude