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
835ac650
Commit
835ac650
authored
Nov 03, 2017
by
wangxuefeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update thrift client
parent
c824aca9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
client.cpp
example/thrift_extension_c++/client.cpp
+4
-6
No files found.
example/thrift_extension_c++/client.cpp
View file @
835ac650
...
...
@@ -31,7 +31,6 @@
bvar
::
LatencyRecorder
g_latency_recorder
(
"client"
);
using
apache
::
thrift
::
protocol
::
TBinaryProtocol
;
using
apache
::
thrift
::
transport
::
TMemoryBuffer
;
using
namespace
std
;
...
...
@@ -69,9 +68,8 @@ int main(int argc, char* argv[]) {
// Append message to `request'
boost
::
shared_ptr
<
TMemoryBuffer
>
o_buffer
(
new
TMemoryBuffer
());
boost
::
shared_ptr
<
TBinaryProtocol
>
oprot
(
new
TBinaryProtocol
(
o_buffer
));
boost
::
shared_ptr
<
apache
::
thrift
::
transport
::
TMemoryBuffer
>
o_buffer
(
new
apache
::
thrift
::
transport
::
TMemoryBuffer
());
boost
::
shared_ptr
<
apache
::
thrift
::
protocol
::
TBinaryProtocol
>
oprot
(
new
apache
::
thrift
::
protocol
::
TBinaryProtocol
(
o_buffer
));
// Construct request
EchoRequest
t_request
;
...
...
@@ -109,8 +107,8 @@ int main(int argc, char* argv[]) {
// Parse/Desrialize binary response to thrift response
boost
::
shared_ptr
<
TMemoryBuffer
>
buffer
(
new
TMemoryBuffer
());
boost
::
shared_ptr
<
TBinaryProtocol
>
iprot
(
new
TBinaryProtocol
(
buffer
));
boost
::
shared_ptr
<
apache
::
thrift
::
transport
::
TMemoryBuffer
>
buffer
(
new
apache
::
thrift
::
transport
::
TMemoryBuffer
());
boost
::
shared_ptr
<
apache
::
thrift
::
protocol
::
TBinaryProtocol
>
iprot
(
new
apache
::
thrift
::
protocol
::
TBinaryProtocol
(
buffer
));
size_t
body_len
=
response
.
head
.
body_len
;
uint8_t
*
thrfit_b
=
(
uint8_t
*
)
malloc
(
body_len
);
...
...
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