*/
#include <libcxml/cxml.h>
+#include <dcp/raw_convert.h>
#include "server_finder.h"
#include "exceptions.h"
#include "util.h"
#include "ui_signaller.h"
using std::string;
-using std::stringstream;
using std::list;
using std::vector;
using std::cout;
using boost::shared_ptr;
using boost::scoped_array;
-using boost::lexical_cast;
+using dcp::raw_convert;
ServerFinder* ServerFinder::_instance = 0;
}
try {
boost::asio::ip::udp::resolver resolver (io_service);
- boost::asio::ip::udp::resolver::query query (*i, lexical_cast<string> (Config::instance()->server_port_base() + 1));
+ boost::asio::ip::udp::resolver::query query (*i, raw_convert<string> (Config::instance()->server_port_base() + 1));
boost::asio::ip::udp::endpoint end_point (*resolver.resolve (query));
socket.send_to (boost::asio::buffer (data.c_str(), data.size() + 1), end_point);
} catch (...) {
ServerFinder::listen_thread ()
try
{
- while (1) {
+ while (true) {
shared_ptr<Socket> sock (new Socket (60));
try {
scoped_array<char> buffer (new char[length]);
sock->read (reinterpret_cast<uint8_t*> (buffer.get()), length);
- stringstream s (buffer.get());
+ string s (buffer.get());
shared_ptr<cxml::Document> xml (new cxml::Document ("ServerAvailable"));
- xml->read_stream (s);
+ xml->read_string (s);
string const ip = sock->socket().remote_endpoint().address().to_string ();
if (!server_found (ip)) {