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
fb27ff31
Unverified
Commit
fb27ff31
authored
Oct 05, 2018
by
Dennis Jenkins
Committed by
GitHub
Oct 05, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #310 from knowledge4igor/code_improvements_3
Code improvements
parents
447cedbe
e7917e04
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
12 deletions
+9
-12
include/pistache/endpoint.h
include/pistache/endpoint.h
+2
-3
include/pistache/listener.h
include/pistache/listener.h
+3
-3
src/server/listener.cc
src/server/listener.cc
+4
-6
No files found.
include/pistache/endpoint.h
View file @
fb27ff31
...
...
@@ -67,10 +67,9 @@ private:
throw
std
::
runtime_error
(
"Must call setHandler() prior to serve()"
);
listener
.
setHandler
(
handler_
);
listener
.
bind
();
if
(
listener
.
bind
())
{
CALL_MEMBER_FN
(
listener
,
method
)();
}
CALL_MEMBER_FN
(
listener
,
method
)();
#undef CALL_MEMBER_FN
}
...
...
include/pistache/listener.h
View file @
fb27ff31
...
...
@@ -31,7 +31,7 @@ class Listener {
public:
struct
Load
{
typedef
std
::
chrono
::
system_clock
::
time_point
TimeP
oint
;
using
TimePoint
=
std
::
chrono
::
system_clock
::
time_p
oint
;
double
global
;
std
::
vector
<
double
>
workers
;
...
...
@@ -49,8 +49,8 @@ public:
int
backlog
=
Const
::
MaxBacklog
);
void
setHandler
(
const
std
::
shared_ptr
<
Handler
>&
handler
);
bool
bind
();
bool
bind
(
const
Address
&
a
dress
);
void
bind
();
void
bind
(
const
Address
&
ad
dress
);
bool
isBound
()
const
;
...
...
src/server/listener.cc
View file @
fb27ff31
...
...
@@ -150,12 +150,12 @@ Listener::pinWorker(size_t worker, const CpuSet& set)
#endif
}
bool
void
Listener
::
bind
()
{
return
bind
(
addr_
);
bind
(
addr_
);
}
bool
void
Listener
::
bind
(
const
Address
&
address
)
{
if
(
!
handler_
)
throw
std
::
runtime_error
(
"Call setHandler before calling bind()"
);
...
...
@@ -201,12 +201,10 @@ Listener::bind(const Address& address) {
listen_fd
=
fd
;
g_listen_fd
=
fd
;
transport_
.
reset
(
new
Transport
(
handler_
)
);
transport_
=
std
::
make_shared
<
Transport
>
(
handler_
);
reactor_
.
init
(
Aio
::
AsyncContext
(
workers_
));
transportKey
=
reactor_
.
addHandler
(
transport_
);
return
true
;
}
bool
...
...
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