Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
035cce37
Commit
035cce37
authored
Dec 06, 2017
by
gejun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow dummy_port to be zero and fix an issue on reading from dummy_server.port
parent
7c28b568
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
17 additions
and
17 deletions
+17
-17
client.cpp
example/cascade_echo_c++/client.cpp
+2
-2
benchmark_http.cpp
example/http_c++/benchmark_http.cpp
+2
-2
client.cpp
example/multi_threaded_echo_c++/client.cpp
+2
-2
client.cpp
example/multi_threaded_echo_fns_c++/client.cpp
+2
-2
client.cpp
example/multi_threaded_mcpack_c++/client.cpp
+2
-2
client.cpp
example/parallel_echo_c++/client.cpp
+2
-2
redis_press.cpp
example/redis_c++/redis_press.cpp
+1
-1
global.cpp
src/brpc/global.cpp
+1
-1
server.cpp
src/brpc/server.cpp
+1
-1
rpc_press.cpp
tools/rpc_press/rpc_press.cpp
+1
-1
rpc_replay.cpp
tools/rpc_replay/rpc_replay.cpp
+1
-1
No files found.
example/cascade_echo_c++/client.cpp
View file @
035cce37
...
...
@@ -36,7 +36,7 @@ DEFINE_string(protocol, "baidu_std", "Protocol type. Defined in src/brpc/options
DEFINE_int32
(
depth
,
0
,
"number of loop calls"
);
// Don't send too frequently in this example
DEFINE_int32
(
sleep_ms
,
100
,
"milliseconds to sleep after each RPC"
);
DEFINE_int32
(
dummy_port
,
0
,
"Launch dummy server at this port"
);
DEFINE_int32
(
dummy_port
,
-
1
,
"Launch dummy server at this port"
);
bvar
::
LatencyRecorder
g_latency_recorder
(
"client"
);
...
...
@@ -122,7 +122,7 @@ int main(int argc, char* argv[]) {
}
}
if
(
FLAGS_dummy_port
>
0
)
{
if
(
FLAGS_dummy_port
>
=
0
)
{
brpc
::
StartDummyServerAt
(
FLAGS_dummy_port
);
}
...
...
example/http_c++/benchmark_http.cpp
View file @
035cce37
...
...
@@ -30,7 +30,7 @@ DEFINE_string(load_balancer, "", "The algorithm for load balancing");
DEFINE_int32
(
timeout_ms
,
100
,
"RPC timeout in milliseconds"
);
DEFINE_int32
(
max_retry
,
3
,
"Max retries(not including the first RPC)"
);
DEFINE_bool
(
dont_fail
,
false
,
"Print fatal when some call failed"
);
DEFINE_int32
(
dummy_port
,
0
,
"Launch dummy server at this port"
);
DEFINE_int32
(
dummy_port
,
-
1
,
"Launch dummy server at this port"
);
DEFINE_string
(
protocol
,
"http"
,
"http or h2c"
);
bvar
::
LatencyRecorder
g_latency_recorder
(
"client"
);
...
...
@@ -106,7 +106,7 @@ int main(int argc, char* argv[]) {
}
}
if
(
FLAGS_dummy_port
>
0
)
{
if
(
FLAGS_dummy_port
>
=
0
)
{
brpc
::
StartDummyServerAt
(
FLAGS_dummy_port
);
}
...
...
example/multi_threaded_echo_c++/client.cpp
View file @
035cce37
...
...
@@ -33,7 +33,7 @@ DEFINE_string(load_balancer, "", "The algorithm for load balancing");
DEFINE_int32
(
timeout_ms
,
100
,
"RPC timeout in milliseconds"
);
DEFINE_int32
(
max_retry
,
3
,
"Max retries(not including the first RPC)"
);
DEFINE_bool
(
dont_fail
,
false
,
"Print fatal when some call failed"
);
DEFINE_int32
(
dummy_port
,
0
,
"Launch dummy server at this port"
);
DEFINE_int32
(
dummy_port
,
-
1
,
"Launch dummy server at this port"
);
DEFINE_string
(
http_content_type
,
"application/json"
,
"Content type of http request"
);
std
::
string
g_request
;
...
...
@@ -113,7 +113,7 @@ int main(int argc, char* argv[]) {
}
g_request
.
resize
(
FLAGS_request_size
,
'r'
);
if
(
FLAGS_dummy_port
>
0
)
{
if
(
FLAGS_dummy_port
>
=
0
)
{
brpc
::
StartDummyServerAt
(
FLAGS_dummy_port
);
}
...
...
example/multi_threaded_echo_fns_c++/client.cpp
View file @
035cce37
...
...
@@ -36,7 +36,7 @@ DEFINE_int32(timeout_ms, 100, "RPC timeout in milliseconds");
DEFINE_int32
(
backup_timeout_ms
,
-
1
,
"backup timeout in milliseconds"
);
DEFINE_int32
(
max_retry
,
3
,
"Max retries(not including the first RPC)"
);
DEFINE_bool
(
dont_fail
,
false
,
"Print fatal when some call failed"
);
DEFINE_int32
(
dummy_port
,
0
,
"Launch dummy server at this port"
);
DEFINE_int32
(
dummy_port
,
-
1
,
"Launch dummy server at this port"
);
DEFINE_string
(
http_content_type
,
"application/json"
,
"Content type of http request"
);
std
::
string
g_attachment
;
...
...
@@ -115,7 +115,7 @@ int main(int argc, char* argv[]) {
g_attachment
.
resize
(
FLAGS_attachment_size
,
'a'
);
}
if
(
FLAGS_dummy_port
>
0
)
{
if
(
FLAGS_dummy_port
>
=
0
)
{
brpc
::
StartDummyServerAt
(
FLAGS_dummy_port
);
}
...
...
example/multi_threaded_mcpack_c++/client.cpp
View file @
035cce37
...
...
@@ -31,7 +31,7 @@ DEFINE_string(load_balancer, "", "The algorithm for load balancing");
DEFINE_int32
(
timeout_ms
,
100
,
"RPC timeout in milliseconds"
);
DEFINE_int32
(
max_retry
,
3
,
"Max retries(not including the first RPC)"
);
DEFINE_bool
(
dont_fail
,
false
,
"Print fatal when some call failed"
);
DEFINE_int32
(
dummy_port
,
0
,
"Launch dummy server at this port"
);
DEFINE_int32
(
dummy_port
,
-
1
,
"Launch dummy server at this port"
);
std
::
string
g_request
;
std
::
string
g_attachment
;
...
...
@@ -109,7 +109,7 @@ int main(int argc, char* argv[]) {
}
g_request
.
resize
(
FLAGS_request_size
,
'r'
);
if
(
FLAGS_dummy_port
>
0
)
{
if
(
FLAGS_dummy_port
>
=
0
)
{
brpc
::
StartDummyServerAt
(
FLAGS_dummy_port
);
}
...
...
example/parallel_echo_c++/client.cpp
View file @
035cce37
...
...
@@ -37,7 +37,7 @@ DEFINE_string(load_balancer, "", "The algorithm for load balancing");
DEFINE_int32
(
timeout_ms
,
100
,
"RPC timeout in milliseconds"
);
DEFINE_int32
(
max_retry
,
3
,
"Max retries(not including the first RPC)"
);
DEFINE_bool
(
dont_fail
,
false
,
"Print fatal when some call failed"
);
DEFINE_int32
(
dummy_port
,
0
,
"Launch dummy server at this port"
);
DEFINE_int32
(
dummy_port
,
-
1
,
"Launch dummy server at this port"
);
std
::
string
g_request
;
std
::
string
g_attachment
;
...
...
@@ -161,7 +161,7 @@ int main(int argc, char* argv[]) {
}
g_request
.
resize
(
FLAGS_request_size
,
'r'
);
if
(
FLAGS_dummy_port
>
0
)
{
if
(
FLAGS_dummy_port
>
=
0
)
{
brpc
::
StartDummyServerAt
(
FLAGS_dummy_port
);
}
...
...
example/redis_c++/redis_press.cpp
View file @
035cce37
...
...
@@ -139,7 +139,7 @@ int main(int argc, char* argv[]) {
}
LOG
(
INFO
)
<<
"Set "
<<
FLAGS_batch
*
FLAGS_thread_num
<<
" values"
;
if
(
FLAGS_dummy_port
>
0
)
{
if
(
FLAGS_dummy_port
>
=
0
)
{
brpc
::
StartDummyServerAt
(
FLAGS_dummy_port
);
}
...
...
src/brpc/global.cpp
View file @
035cce37
...
...
@@ -126,7 +126,7 @@ static long ReadPortOfDummyServer(const char* filename) {
<<
(
nr
==
0
?
"nothing to read"
:
berror
());
return
-
1
;
}
port_str
[
s
izeof
(
port_str
)
-
1
]
=
'\0'
;
port_str
[
s
td
::
min
((
size_t
)
nr
,
sizeof
(
port_str
)
-
1
)
]
=
'\0'
;
const
char
*
p
=
port_str
;
for
(;
isspace
(
*
p
);
++
p
)
{}
char
*
endptr
=
NULL
;
...
...
src/brpc/server.cpp
View file @
035cce37
...
...
@@ -1645,7 +1645,7 @@ static pthread_mutex_t g_dummy_server_mutex = PTHREAD_MUTEX_INITIALIZER;
static
Server
*
g_dummy_server
=
NULL
;
int
StartDummyServerAt
(
int
port
,
ProfilerLinker
)
{
if
(
port
<
=
0
||
port
>=
65536
)
{
if
(
port
<
0
||
port
>=
65536
)
{
LOG
(
ERROR
)
<<
"Invalid port="
<<
port
;
return
-
1
;
}
...
...
tools/rpc_press/rpc_press.cpp
View file @
035cce37
...
...
@@ -89,7 +89,7 @@ int main(int argc, char* argv[]) {
GFLAGS_NS
::
ParseCommandLineFlags
(
&
argc
,
&
argv
,
true
);
// set global log option
if
(
FLAGS_dummy_port
>
0
)
{
if
(
FLAGS_dummy_port
>
=
0
)
{
brpc
::
StartDummyServerAt
(
FLAGS_dummy_port
);
}
...
...
tools/rpc_replay/rpc_replay.cpp
View file @
035cce37
...
...
@@ -208,7 +208,7 @@ int main(int argc, char* argv[]) {
return
-
1
;
}
if
(
FLAGS_dummy_port
>
0
)
{
if
(
FLAGS_dummy_port
>
=
0
)
{
brpc
::
StartDummyServerAt
(
FLAGS_dummy_port
);
}
...
...
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