代码拉取完成,页面将自动刷新
FDBus
is a middleware development framework targeting the following objectives:
IPC
) within single host and cross the networkWindows
, Linux
, QNX
)It is something like DBus
or SOME/IP
, but with its own characteristic:
DBus
, it has no central hubIPC
machanism. it is a middleware development frameworkIts usage can be found in the following fields:
Linux
Windows
QNX
https://github.com/jeremyczhen/fdbus.git
https://blog.csdn.net/jeremy_cz/article/details/89060291
It is recommended to build with buildCentral.
- sudo pip install python-magic
- sudo pip install networkx
- sudo pip install simplejson
- git clone https://github.com/jeremyczhen/fdbus.git
- git clone https://github.com/jeremyczhen/protobuf.git
output/stage/host
.
- tools/buildCentral/install/mk -thost
output/stage/$variant/$target_arch/
:
- tools/buildCentral/install/mk -tarm-qnx - build for ARM QNX
- tools/buildCentral/install/mk -twin-lin - build for Windows Linario
project/build/buildcentralrc
For more details please find help for buildCentral
[1] |
Dependence:
cd ~/workspace
git clone https://github.com/jeremyczhen/fdbus.git #get fdbus source code
cd fdbus;mkdir -p build/install;cd build #create directory for out-of-source build
cmake -DCMAKE_INSTALL_PREFIX=install ../cmake
make install
Dependence:
cd ~/workspace
git clone https://github.com/jeremyczhen/fdbus.git
cd fdbus;mkdir -p build/install;cd build
#update ../cmake/toolchain.cmake (see below example)
cmake -DCMAKE_INSTALL_PREFIX=install -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain.cmake ../cmake
make install
The same as cross compiling, but the following option should be added to cmake due to minor difference in QNX SDP:
-Dfdbus_SOCKET_ENABLE_PEERCRED=OFF -Dfdbus_PIPE_AS_EVENTFD=true -Dfdbus_LINK_SOCKET_LIB=true
[2] | (1, 2) |
Dependence:
cd ~/workspace
git clone https://github.com/protocolbuffers/protobuf.git #get protobuf source code
cd protobuf;git submodule update --init --recursive
mkdir -p build/install;cd build #create directory for out-of-source build
cmake -DCMAKE_INSTALL_PREFIX=install -DBUILD_SHARED_LIBS=1 ../cmake
make -j4 install #build and install to build/install directory
cd ~/workspace/fdbus;mkdir -p build-example/install;cd build-example #create directory for out-of-source build
cmake -DSYSTEM_ROOT=~/workspace/protobuf/build/install;~/workspace/fdbus/build/install -DCMAKE_INSTALL_PREFIX=install ../cmake
PATH=~/workspace/protobuf/build/install/bin:$PATH make install #set PATH to the directory where protoc can be found
Dependence:
1 build protocol buffer
- cd c:\workspace
- suppose source code of protocol buffer is already downloaded and placed at c:\workspace\protobuf
- create directory c:\workspace\protobuf\cbuild\install and enter c:\protobuf\fdbus\cbuild
- cmake -DCMAKE_INSTALL_PREFIX=install -Dprotobuf_WITH_ZLIB=OFF ..\cmake
- open protobuf.sln in c:workspaceprotobufcbuild and build project INSTALL
- create directory c:\workspace\fdbus\build-example\install and enter c:\workspace\fdbus\build-example
- cmake -DSYSTEM_ROOT=c:\workspace\protobuf\build\install;c:\workspace\fdbus\build\install -DCMAKE_INSTALL_PREFIX=install ..\cmake\pb-example
- copy c:\workspace\protobuf\cbuild\install\bin\protoc.exe to the directory in PATH environment variable
- open fdbus.sln in c:\workspace\fdbus\build-example and build project INSTALL
> name_server
host1> name_server
host1> host_server
host2> name_server -u tcp://ip_of_host1:60000
> cat toolchain.cmake SET(CMAKE_SYSTEM_NAME Linux) SET(CMAKE_CXX_COMPILER $ENV{QNX_HOST}/usr/bin/q++) SET(CMAKE_C_COMPILER $ENV{QNX_HOST}/usr/bin/qcc)
-Dfdbus_XXX=ON/OFF
when running cmake
.*
is set as default.fdbus_BUILD_TESTS
OFF
: don't build examplesfdbus_ENABLE_LOG
OFF
: disable log output of fdbus libfdbus_LOG_TO_STDOUT
ON
: send fdbus log to stdout (terminal)fdbus_ENABLE_MESSAGE_METADATA
OFF
: time stamp is disabledfdbus_SOCKET_BLOCKING_CONNECT
ON
: socket method connect() will be blocked forever if server is not ready to acceptfdbus_SOCKET_ENABLE_PEERCRED
OFF
: peercred of UDS is disabledfdbus_ALLOC_PORT_BY_SYSTEM
ON
: socket number of servers are allocated by the systemfdbus_SECURITY
ON
: enable securityfdbus_BUILD_JNI
ON
: build JNI shared library and jar package-DMACRO_DEF='VARIABLE=value;VARIABLE=value'
FDB_CFG_SOCKET_PATH
CONFIG_SOCKET_CONNECT_TIMEOUT
0
" means block forever.1. server registers its name toname server
;2.name server
reply with URL and token;3. server binds to the URL and holds the token;4. client requests name resolution fromname server
;5.name server
authenticate client by checking peercred (SO_PEERCRED
option of socket), includingUID
,GID
of the client6. if success,name server
gives URL and token of requested server to the client7. client connects to the server with URL followed by sending the token to the server8. server verify the token and grant the connection if pass; for unauthorized client, since it does not have a valid token, server will drop the connection9.name server
can assign multiple tokens to server but only send one of them to the client according to security level of the client
TBD
1. Issue: sem_timedwait() is used as notifier and blocker of event loop, leading to timer failure when TOD is changed since sem_wait() take CLOCK_REALTIME clock for timeout control.Solution: When creating worker thread, pass FDB_WORKER_ENABLE_FD_LOOP as parameter, forcing poll() instead of sem_timedwait() as loop notifier and blocker
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。