Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pistache
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
pistache
Commits
63aca181
Commit
63aca181
authored
Oct 07, 2018
by
knowledge4igor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add address reuse in http client test
parent
61af27cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
tests/http_client_test.cc
tests/http_client_test.cc
+6
-6
No files found.
tests/http_client_test.cc
View file @
63aca181
#include "gtest/gtest.h"
#include <pistache/http.h>
#include <pistache/client.h>
#include <pistache/endpoint.h>
#include "gtest/gtest.h"
#include <chrono>
using
namespace
Pistache
;
...
...
@@ -11,9 +11,8 @@ using namespace Pistache;
struct
HelloHandler
:
public
Http
::
Handler
{
HTTP_PROTOTYPE
(
HelloHandler
)
void
onRequest
(
const
Http
::
Request
&
request
,
Http
::
ResponseWriter
writer
)
void
onRequest
(
const
Http
::
Request
&
/*request*/
,
Http
::
ResponseWriter
writer
)
{
UNUSED
(
request
)
writer
.
send
(
Http
::
Code
::
Ok
,
"Hello, World!"
);
}
};
...
...
@@ -22,7 +21,8 @@ TEST(request_builder, multiple_send_test) {
const
std
::
string
address
=
"localhost:9080"
;
Http
::
Endpoint
server
(
address
);
auto
server_opts
=
Http
::
Endpoint
::
options
().
threads
(
1
);
auto
flags
=
Tcp
::
Options
::
InstallSignalHandler
|
Tcp
::
Options
::
ReuseAddr
;
auto
server_opts
=
Http
::
Endpoint
::
options
().
flags
(
flags
).
threads
(
1
);
server
.
init
(
server_opts
);
server
.
setHandler
(
Http
::
make_handler
<
HelloHandler
>
());
server
.
serveThreaded
();
...
...
@@ -54,4 +54,4 @@ TEST(request_builder, multiple_send_test) {
client
.
shutdown
();
ASSERT_TRUE
(
response_counter
==
RESPONSE_SIZE
);
}
\ No newline at end of file
}
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