Boost logo

Boost Users :

From: Johan Nilsson (r.johan.nilsson_at_[hidden])
Date: 2008-08-11 09:40:00


John Urberg wrote:
> John Urberg <john-urberg <at> idexx.com> 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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net