Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
dcdb
dcdb
Commits
0c265b79
Commit
0c265b79
authored
Sep 08, 2016
by
Michael Ott
Browse files
Set http socket's option REUSEADDR
parent
4e6cdf9a
Changes
1
Hide whitespace changes
Inline
Side-by-side
CollectAgent/collectagent.cpp
View file @
0c265b79
...
...
@@ -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"
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment