Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ademco_hb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
ademco_hb
Commits
5b3abf56
Commit
5b3abf56
authored
Jul 30, 2020
by
captainwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NDEBUG
parent
60868ed3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
build.sh
examples/build.sh
+1
-1
server_demo_libevent.cpp
examples/server_demo_libevent/server_demo_libevent.cpp
+1
-1
No files found.
examples/build.sh
View file @
5b3abf56
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
mkdir
-p
build
mkdir
-p
build
cd
build
cd
build
opt
=
-O3
opt
=
'-O3 –DNDEBUG'
g++
-std
=
c++11
$opt
../bench/bench.cpp
-I
../../include
-o
bench
g++
-std
=
c++11
$opt
../bench/bench.cpp
-I
../../include
-o
bench
g++
-std
=
c++11
$opt
../demo/demo.cpp
-I
../../include
-o
demo
g++
-std
=
c++11
$opt
../demo/demo.cpp
-I
../../include
-o
demo
g++
-std
=
c++11
$opt
../server_demo/server_demo.cpp
-I
../../include
-lpthread
-o
server_demo
g++
-std
=
c++11
$opt
../server_demo/server_demo.cpp
-I
../../include
-lpthread
-o
server_demo
...
...
examples/server_demo_libevent/server_demo_libevent.cpp
View file @
5b3abf56
...
@@ -203,7 +203,7 @@ void accept_cb(evconnlistener* listener, evutil_socket_t fd, sockaddr* addr, int
...
@@ -203,7 +203,7 @@ void accept_cb(evconnlistener* listener, evutil_socket_t fd, sockaddr* addr, int
char
str
[
INET_ADDRSTRLEN
]
=
{
0
};
char
str
[
INET_ADDRSTRLEN
]
=
{
0
};
auto
sin
=
(
sockaddr_in
*
)
addr
;
auto
sin
=
(
sockaddr_in
*
)
addr
;
inet_ntop
(
AF_INET
,
&
sin
->
sin_addr
,
str
,
INET_ADDRSTRLEN
);
inet_ntop
(
AF_INET
,
&
sin
->
sin_addr
,
str
,
INET_ADDRSTRLEN
);
printf
(
"accpet TCP connection
from: %s:%d
\n
"
,
str
,
sin
->
sin_port
);
printf
(
"accpet TCP connection
#%d from: %s:%d
\n
"
,
fd
,
str
,
sin
->
sin_port
);
evutil_make_socket_nonblocking
(
fd
);
evutil_make_socket_nonblocking
(
fd
);
...
...
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