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
b75dbd03
Commit
b75dbd03
authored
May 22, 2018
by
wangxuefeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix native server issue
parent
43ee7e1c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
3 deletions
+16
-3
.travis.yml
.travis.yml
+1
-1
thrift.md
docs/cn/thrift.md
+0
-0
thrift.md
docs/en/thrift.md
+0
-0
native_server.cpp
example/thrift_extension_c++/native_server.cpp
+14
-2
thrift_utils.h
src/brpc/details/thrift_utils.h
+1
-0
No files found.
.travis.yml
View file @
b75dbd03
...
...
@@ -17,7 +17,7 @@ before_script:
before_install
:
-
wget --no-clobber https://github.com/bazelbuild/bazel/releases/download/0.8.1/bazel_0.8.1-linux-x86_64.deb
-
sudo dpkg -i bazel_0.8.1-linux-x86_64.deb
-
wget http://www.us.apache.org/dist/thrift/0.
9.3/thrift-0.9.3.tar.gz && tar -xf thrift-0.9.3.tar.gz && cd thrift-0.9.3/ && ./configure --prefix=/usr --with-ruby=no --with-python=no --with-java=no --with-go=no --with-perl=no --with-php=no --with-csharp=no --with-erlang=no --with-lua=no --with-nodejs=no && make
-j 3 -s && sudo make install && cd -
-
wget http://www.us.apache.org/dist/thrift/0.
11.0/thrift-0.11.0.tar.gz && tar -xf thrift-0.11.0.tar.gz && cd thrift-0.11.0/ && ./configure --prefix=/usr --with-ruby=no --with-python=no --with-java=no --with-go=no --with-perl=no --with-php=no --with-csharp=no --with-erlang=no --with-lua=no --with-nodejs=no && make CPPFLAGS=-DFORCE_BOOST_SMART_PTR
-j 3 -s && sudo make install && cd -
install
:
-
sudo apt-get install -qq realpath libgflags-dev libprotobuf-dev libprotoc-dev protobuf-compiler libleveldb-dev libgoogle-perftools-dev libboost-dev libssl-dev libevent-dev libboost-test-dev
...
...
docs/cn/thrift.md
View file @
b75dbd03
This diff is collapsed.
Click to expand it.
docs/en/thrift.md
View file @
b75dbd03
This diff is collapsed.
Click to expand it.
example/thrift_extension_c++/native_server.cpp
100644 → 100755
View file @
b75dbd03
...
...
@@ -19,6 +19,7 @@
#include <butil/logging.h>
#include "gen-cpp/EchoService.h"
#include <thrift/protocol/TBinaryProtocol.h>
#include <thrift/server/TSimpleServer.h>
#include <thrift/transport/TServerSocket.h>
...
...
@@ -27,9 +28,11 @@
#include <thrift/concurrency/PosixThreadFactory.h>
// _THRIFT_STDCXX_H_ is defined by thrift/stdcxx.h which was added since thrift 0.11.0
#include <thrift/TProcessor.h> // to include stdcxx.h if present
#ifndef THRIFT_STDCXX
#if defined(_THRIFT_STDCXX_H_)
# define THRIFT_STDCXX apache::thrift::stdcxx
#include <thrift/transport/TNonblockingServerSocket.h>
#else
# define THRIFT_STDCXX boost
#endif
...
...
@@ -67,14 +70,23 @@ int main(int argc, char *argv[]) {
new
apache
::
thrift
::
transport
::
TBufferedTransportFactory
());
THRIFT_STDCXX
::
shared_ptr
<
apache
::
thrift
::
concurrency
::
ThreadManager
>
thread_mgr
(
apache
::
thrift
::
concurrency
::
ThreadManager
::
newSimpleThreadManager
(
2
));
thread_mgr
->
threadFactory
(
thread_factory
);
thread_mgr
->
start
();
#if defined(_THRIFT_STDCXX_H_)
THRIFT_STDCXX
::
shared_ptr
<
apache
::
thrift
::
transport
::
TNonblockingServerSocket
>
server_transport
=
THRIFT_STDCXX
::
make_shared
<
apache
::
thrift
::
transport
::
TNonblockingServerSocket
>
(
FLAGS_port
);
apache
::
thrift
::
server
::
TNonblockingServer
server
(
processor
,
transport_factory
,
transport_factory
,
protocol_factory
,
protocol_factory
,
FLAGS_port
,
thread_mgr
);
protocol_factory
,
server_transport
);
#else
apache
::
thrift
::
server
::
TNonblockingServer
server
(
processor
,
transport_factory
,
transport_factory
,
protocol_factory
,
protocol_factory
,
FLAGS_port
);
#endif
server
.
serve
();
return
0
;
}
src/brpc/details/thrift_utils.h
View file @
b75dbd03
...
...
@@ -32,6 +32,7 @@
# define THRIFT_STDCXX apache::thrift::stdcxx
#else
# define THRIFT_STDCXX boost
#include <boost/make_shared.hpp>
#endif
#endif
...
...
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