mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-17 11:06:16 +02:00
server & client connection
git-svn-id: svn://elaine/murooma/trunk@270 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
parent
d85858ac62
commit
2cf7855261
15 changed files with 184 additions and 123 deletions
43
server/serverConnection.cpp
Normal file
43
server/serverConnection.cpp
Normal file
|
@ -0,0 +1,43 @@
|
|||
#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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue