fixed connect problem

This commit is contained in:
badaix 2015-09-06 21:36:53 +02:00
parent 817755a8b7
commit 86a9b6ca90
2 changed files with 5 additions and 7 deletions

View file

@ -64,14 +64,12 @@ private:
void handleAccept(socket_ptr socket);
// void acceptor();
mutable std::mutex mutex_;
size_t port_;
std::set<std::shared_ptr<ControlSession>> sessions_;
boost::asio::io_service* io_service_;
std::shared_ptr<tcp::acceptor> acceptor_;
// std::thread acceptThread_;
Queue<std::shared_ptr<msg::BaseMessage>> messages_;
boost::asio::io_service* io_service_;
size_t port_;
ControlMessageReceiver* controlMessageReceiver_;
};

View file

@ -133,12 +133,12 @@ int main(int argc, char* argv[])
settings.sampleFormat = sampleFormat;
boost::asio::io_service io_service;
auto func = [](boost::asio::io_service* ioservice)->void{ioservice->run();};
std::thread t(func, &io_service);
std::unique_ptr<StreamServer> streamServer(new StreamServer(&io_service, settings));
streamServer->start();
auto func = [](boost::asio::io_service* ioservice)->void{ioservice->run();};
std::thread t(func, &io_service);
while (!g_terminated)
usleep(100*1000);