mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-29 17:06:18 +02:00
123
git-svn-id: svn://elaine/murooma/trunk@232 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
parent
f43e1ec18c
commit
83aa516ee0
4 changed files with 37 additions and 127 deletions
|
@ -1,31 +1,3 @@
|
|||
//
|
||||
// blocking_tcp_echo_server.cpp
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
//
|
||||
// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
/*
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <boost/asio.hpp>
|
||||
#include <boost/program_options.hpp>
|
||||
#include <chrono>
|
||||
#include <vector>
|
||||
#include <ctime> // localtime
|
||||
#include <sstream> // stringstream
|
||||
#include <iomanip>
|
||||
#include <thread>
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include "common/chunk.h"
|
||||
#include "pcmEncoder.h"
|
||||
#include "oggEncoder.h"
|
||||
#include <syslog.h>
|
||||
*/
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <boost/asio.hpp>
|
||||
|
@ -80,14 +52,7 @@ public:
|
|||
shared_ptr<BaseMessage> message(messages.pop());
|
||||
message->serialize(stream);
|
||||
boost::asio::write(*socket_, streambuf);
|
||||
/* size_t written(0);
|
||||
size_t toWrite = message->getSize();
|
||||
do
|
||||
{
|
||||
written += boost::asio::write(*socket_, streambuf);//, error);
|
||||
}
|
||||
while (written < toWrite);
|
||||
*/ }
|
||||
}
|
||||
}
|
||||
catch (std::exception& e)
|
||||
{
|
||||
|
@ -142,8 +107,6 @@ public:
|
|||
a.accept(*sock);
|
||||
cout << "New connection: " << sock->remote_endpoint().address().to_string() << "\n";
|
||||
Session* session = new Session(sock);
|
||||
if (headerChunk)
|
||||
cout << "Sending header: " << headerChunk->payloadSize << endl;
|
||||
session->send(headerChunk);
|
||||
session->start();
|
||||
sessions.insert(shared_ptr<Session>(session));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue