11 Aug
2008
11 Aug
'08
1:40 p.m.
John Urberg wrote:
John Urberg
writes:
[snip]
Here is how I'm starting the MulticastServer:
void SocketClientConnector::Start(const string& connectionName) throw(exception) { this->name = connectionName; service_thread = new boost::thread(boost::bind(&SocketClientConnector::RunServiceThread, this)); }
void SocketClientConnector::RunServiceThread() { try { MulticastServer server(io_service, group_address, group_port, server_port, name, id, interval); server.Start(); } catch (exception& e) { std::cout << e.what() << std::endl; } io_service.run();
At the point you actually run the io service, the server object has been destroyed. Move the io_service.run() statement to right after server.Start(). HTH / Johan