snapcast/server/serverConnection.cpp
(no author) feabfee936 xxxx
git-svn-id: svn://elaine/murooma/trunk@272 d8a302eb-03bc-478d-80e4-98257eca68ef
2014-09-17 21:58:38 +00:00

43 lines
576 B
C++

#include "serverConnection.h"
#include <boost/lexical_cast.hpp>
#include <iostream>
#include <mutex>
#include "common/log.h"
using namespace std;
ServerConnection::ServerConnection(MessageReceiver* _receiver, std::shared_ptr<tcp::socket> _socket) : SocketConnection(_receiver)
{
socket = _socket;
}
void ServerConnection::worker()
{
active_ = true;
try
{
while (active_)
{
getNextMessage();
}
}
catch (const std::exception& e)
{
cout << kLogNotice << "Exception: " << e.what() << ", trying to reconnect" << std::endl;
}
active_ = false;
}