Commit 0c265b79 authored by Michael Ott's avatar Michael Ott
Browse files

Set http socket's option REUSEADDR

parent 4e6cdf9a
......@@ -85,17 +85,15 @@ struct http_handler {
DCDB::SensorId sid;
sid.mqttTopicConvert(request.destination);
std::ostringstream data;
static server::response_header headers[] = {{"Connection", "close"},
{"Content-Type", "text/plain"}};
static server::response_header headers[] = {{"Connection", "close"}, {"Content-Type", "text/plain"}};
//try getting the latest value
try {
uint64_t val = mySensorCache.getSensor(sid);
data << val;
data << val << "\n";
//data << "Sid : " << sid.toString() << ", Value: " << val << "." << std::endl;
connection->set_status(server::connection::ok);
......@@ -316,6 +314,7 @@ int main(int argc, char* const argv[]) {
/*<< Creates the server. >>*/
server::options options(handler);
options.reuse_address(true);
options.thread_pool(std::make_shared<boost::network::utils::thread_pool>());
server server_(options.address("127.0.0.1").port("8080"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment