Event-driven network library for multi-threaded Linux server in C++11

Overview
Muduo is a multithreaded C++ network library based on
the reactor pattern.

http://github.com/chenshuo/muduo

Copyright (c) 2010, Shuo Chen.  All rights reserved.

Use of this source code is governed by a BSD-style
license that can be found in the License file.

Requires:
  Linux kernel version >= 2.6.28.
  GCC >= 4.7 or Clang >= 3.5
  Boost (for boost::any only.)

Tested on:
  Debian 7 and above
  Unbuntu 14.04 and above
  CentOS 7 and above

Install required packages:
  # Debian, Ubuntu, etc.
  $ sudo apt install g++ cmake make libboost-dev
  # CentOS
  $ sudo yum install gcc-c++ cmake make boost-devel

See .travis.yml for additional packages for building more examples.

To build, run:
  ./build.sh

See https://github.com/chenshuo/muduo-tutorial for
how to use muduo in your project.
  __  __           _
 |  \/  |         | |
 | \  / |_   _  __| |_   _  ___
 | |\/| | | | |/ _` | | | |/ _ \
 | |  | | |_| | (_| | |_| | (_) |
 |_|  |_|\__,_|\__,_|\__,_|\___/

Issues
  • Enhance the robustness

    Enhance the robustness

    server端一开始是监听reading事件的, 当应用层读完所有数据的时候,应用层可能会调用 channel->disableReading() EPollPoller.cc:updateChannel 逻辑会将该 channel->fd_ 从 epoll 中移出。

    当Client端断开连接时,会依次调用 TcpConnection::handleClose()、channel->disableReading()、EPollPoller.cc:updateChannel等 然而 EPollPoller.cc:updateChannel 这里的状态机不满足这种调用场景,又会将该 channel::fd_ 放入 epoll 中, 这样会造成不必要的系统调用,同时状态也更复杂。

    因此做一个基本的检查,如果没有事件要监听的话,就不添加到epoll中。

    opened by weizili 19
  • How to know Tcpclient fail to connect with a server?

    How to know Tcpclient fail to connect with a server?

    I can not find a function(or method) to detect the connection failure with a server when TcpClient try to connect with a server. How to know connection failure?

    opened by tachoi 16
  • 一次loop中的失效事件的处理问题

    一次loop中的失效事件的处理问题

    硕神你好,你的linux多线程服务端编程我拜读过了,你的网课也上过,muduo 也看了两遍,对我帮助非常大,很感谢你的的分享。 最近在读 nginx,两者都为事件驱动,不禁做了些比较,也有一些疑惑,想请教一下:

    1.nginx 对于一次 loop 返回的多个事件,前面先处理的事件可能会导致后面事件的失效(比如第一个处理的事件在某些条件下关闭了这次返回的事件列表中排在第二位的事件对应的链接),其通过 event 中的 instance 字段基本实现了可以跳过这种失效的事件的情况,但是貌似在 muduo 中做不到,本来我以为 muduo 的 channel.tie 方法可以做到,但是仔细看了代码加上试验后发现并不能组织在这次 loop 中处理后面失效事件的问题(即使是使用单线程模型也是,因为 removeConnection 中调用了 queueInLoop,所以一个 connptr 的析构是不可能发生在一次 loop 的 eventhandling 阶段的),这个是否可以作为一个改进点呢?

    2.这个也是由前面的问题引出的,muduo 中 mainthread(listen thread)保存了一份 conn_map,所以在多线程模式下, connptr 的处理显得很复杂,需要先在 conn's ioloop 中关闭对读写事件的关注,然后通过回调,在 mainthread erase map 中的数据,最后再通过回调,在 conn's ioloop 将 channel 从 eventloop 中移除掉。我主要不解的是 a.为什么一定要在 mainthread 保存一份 conn_map 呢,如果 conn 也仅有其所属的 eventloop 去处理,那么就更容易避免多线程 race 了? b.handleClose 中先 disable 了全部事件,但是没有 remove channel,而是在 mainthread erase 之后在通过回调做这个事情,这两个步骤拆开的原因是?

    opened by neal-zhu 15
  • Check return codes everywhere

    Check return codes everywhere

    opened by elfring 12
  • 工作了几年再看代码写的很一般

    工作了几年再看代码写的很一般

    Linux distro and version? x86 or ARM? 32-bit or 64-bit?

    Branch (master/cpp11/cpp17) and version of muduo?

    Version of cmake, gcc and boost? (If not from distro.)

    opened by lilijreey 11
  • main loop+many sub loop+ threadpoll 限制连接数示例结合踢掉空闲连接

    main loop+many sub loop+ threadpoll 限制连接数示例结合踢掉空闲连接

    陈哥,请假。我使用的是main ractor+many sub ractor+ thread pool模式处理的,且结合了bucket剔除空闲连接和限制连接数目。目的,测试连接数限制是否可用,但是结果挂了,如下: exception caught in Thread subEventThPool1 reason: boost::bad_any_cast: failed conversion using boost::any_cast 已放弃(吐核)

    调试: Program terminated with signal 6, Aborted. #0 0x00007fcabb03b5f7 in __GI_raise ([email protected]=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 56 return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig); (gdb) bt #0 0x00007fcabb03b5f7 in __GI_raise ([email protected]=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 #1 0x00007fcabb03cce8 in GI_abort () at abort.c:90 #2 0x0000000000447626 in runInThread (this=0x1d83ff0) at /home/wbq/muduo-master/muduo/base/Thread.cpp:103 #3 muduo::detail::startThread (obj=0x1d83ff0) at /home/wbq/muduo-master/muduo/base/Thread.cpp:126 #4 0x00007fcabc161dc5 in start_thread (arg=0x7fcab5f91700) at pthread_create.c:308 #5 0x00007fcabb0fcced in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113 **死到onStringMessage函数了, solve中没办法使用非静态成员connectionBuckets**。 void SudokuServer::onStringMessage(const TcpConnectionPtr& conn, const string& message, Timestamp) { processRequest(conn, message); assert(!conn->getContext().empty()); WeakEntryPtr weakEntry(boost::any_cast(conn->getContext())); EntryPtr entry(weakEntry.lock()); if (entry) { connectionBuckets.back().insert(entry); } } void SudokuServer::solve(const TcpConnectionPtr& conn, const string& request) { muduo::net::Buffer buf; buf.append("hello"); int32_t len = static_cast<int32_t>(strlen("hello")); int32_t be32 = muduo::net::sockets::hostToNetwork32(len); buf.prepend(&be32, sizeof be32); conn->send(&buf); }

    void SudokuServer::processRequest(const TcpConnectionPtr& conn, const string& request) { threadPool_.run(boost::bind(&solve, conn, request)); }

    加锁也不好使。 if (mutex_){ MutexLockGuard lock(*mutex_); connectionBuckets_.back().insert(entry); }

    opened by ygm521 11
  • handleClosed可能导致服务端的数据不能完整的发送到客户端?

    handleClosed可能导致服务端的数据不能完整的发送到客户端?

    如果客户端调用shutdown关闭写,服务端handleRead将读取到0,并调用handleClose。 而handleClose中会调用channel_->disableAll(); 停止监听该TcpConnection上的所有事件(包括POLLOUT)。并且最后的closeCallback_(guardThis);将会把channel从eventloop中移除。 如果这时TcpConnection还有数据在outputBuffer_中,那么这些在buf中的数据将没有机会发送到客户端了。

    opened by ideascf 11
  • Completion of error handling

    Completion of error handling

    opened by elfring 11
  • Data race in AsyncLogging

    Data race in AsyncLogging

    陈老师你好,最近在学习 AsyncLogging 部分的时候,发现一个可能的潜在 data race 问题: 在 threadFunc 中 while (running_) 与 stop 中的 running_ = false 语句可能会存在对 running_ 访问的 data race,改成 atomic<bool> 应该可以解决这个问题。 当然如果程序永远在循环中不退出的话是不会有问题的,不知道这个地方是否有必要修改一下?

    opened by ColdOrange 10
  • muduo-master/examples/asio/chat 里面的./asio_chat_client 进入死循环

    muduo-master/examples/asio/chat 里面的./asio_chat_client 进入死循环

    muduo-master/examples/asio/chat 里面的./asio_chat_client 进入死循环。看到客户端表现如下,不断的重新连接。 20150323 10:03:38.336293Z 6660 INFO 169.254.10.12:34128 -> 169.254.10.12:26888 is UP - client.cc:53 20150323 10:03:38.336324Z 6660 INFO 169.254.10.12:34128 -> 169.254.10.12:26888 is DOWN - client.cc:53 20150323 10:03:38.857066Z 6660 INFO TcpClient::connect[ChatClient] - Reconnecting to 169.254.10.12:26888 - TcpClient.cc:178 20150323 10:03:38.857196Z 6660 INFO 169.254.10.12:34130 -> 169.254.10.12:26888 is UP - client.cc:53 20150323 10:03:38.857328Z 6660 INFO 169.254.10.12:34130 -> 169.254.10.12:26888 is DOWN - client.cc:53 20150323 10:03:38.857345Z 6660 INFO TcpClient::connect[ChatClient] - Reconnecting to 169.254.10.12:26888 - TcpClient.cc:178

    测试过程如下:

    1. 使用了 nginx 的TCP反向代理插件,https://github.com/yaoweibin/nginx_tcp_proxy_module
    2. 配置了 nginx 的 TCP 反向代理后,开始启动服务测试。
    3. 启动 asio_chat_server
    4. 启动 nginx
    5. 启动 asio_chat_client,发送数据,一切正常.
    6. 然后把 nginx 关闭或者重启(../sbin/nginx -s reload;../sbin/nginx -s reopen) ,重新把 nginx 起来,asio_chat_client 再发送数据进入了死循环。
    7. 就是关闭 asio_chat_client ,再起来,也一直是死循环。需要过了nginx 的自检时间, 也就是过了 nginx 和 asio_chat_server 的检查时间才能正常。
    opened by hzhxxx 10
  • Acceptor.cc里面的Acceptor::Acceptor构造函数内setReadCallback问题

    Acceptor.cc里面的Acceptor::Acceptor构造函数内setReadCallback问题

    acceptChannel_.setReadCallback(boost::bind(&Acceptor::handleRead, this)); 其中对象实例acceptChannel_属于Channel,setReadCallback函数声明是 void Channel::setReadCallback(const ReadEventCallback& cb); 但是 Acceptor::handleRead 是无参数的声明和定义 void Acceptor::handleRead(); 按理 acceptChannel_.setReadCallback(boost::bind(&Acceptor::handleRead, this)); 应该增加 std::placeholders::_1 更好吧。

    opened by hzhxxx 10
  • 安装报错,protobuf

    安装报错,protobuf

    GitHub issues are for tracking bugs, not for general discussing like a forum.

    If you have a general question to ask, send it to mailing list:

    [email protected]

    Or visit: https://groups.google.com/forum/#!forum/muduo-library

    When file an issue muduo, please provide a SSCCE: Short, Self Contained, Correct (Compilable), Example.

    If you can't compile muduo, make sure you install cmake and boost from the official package repository, e.g. apt or yum, before opening a bug. Don't open a bug if you installed boost from a third-party source or downloaded it by yourself, and couldn't compile muduo, thank you.

    Also specify the exact environment where the issue occurs:

    Linux distro and version? x86 or ARM? 32-bit or 64-bit?

    Linux Ubuntu 18.04.6 LTS 64-bit

    Branch (cpp98/cpp11/cpp17) and version of muduo?

    cpp11 muduo-2.0.2

    Version of cmake, gcc and boost? (If not from distro.)

    cmake 3.10.2 gcc 7.5.0 boost 1.65.1 protoc --version libprotoc 2.6.1

    运行 :./build.sh -j2 ++ pwd

    • SOURCE_DIR=/muduo-2.0.0
    • BUILD_DIR=../build
    • BUILD_TYPE=release
    • INSTALL_DIR=../release-install-cpp11
    • CXX=g++
    • ln -sf ../build/release-cpp11/compile_commands.json
    • mkdir -p ../build/release-cpp11
    • cd ../build/release-cpp11
    • cmake -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=../release-install-cpp11 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON /muduo-2.0.0 -- The C compiler identification is GNU 7.5.0 -- The CXX compiler identification is GNU 7.5.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Boost version: 1.65.1 -- Looking for pthread.h -- Looking for pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE -- Found Protobuf: /usr/local/lib/libprotobuf.so;-lpthread (found version "2.6.1") -- Found CURL: /usr/lib/x86_64-linux-gnu/libcurl.so (found version "7.58.0") -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11") -- found cares -- found curl -- found protobuf -- found zlib -- CXX_FLAGS = -g -DCHECK_PTHREAD_RETURN_VALUE -D_FILE_OFFSET_BITS=64 -Wall -Wextra -Werror -Wconversion -Wno-unused-parameter -Wold-style-cast -Woverloaded-virtual -Wpointer-arith -Wshadow -Wwrite-strings -march=native -std=c++11 -rdynamic -O2 -DNDEBUG -- Looking for accept4 -- Looking for accept4 - found -- Configuring done -- Generating done -- Build files have been written to: /build/release-cpp11
    • make -j2 Scanning dependencies of target atomic_unittest Scanning dependencies of target muduo_base [ 0%] Building CXX object muduo/base/tests/CMakeFiles/atomic_unittest.dir/Atomic_unittest.cc.o [ 0%] Building CXX object muduo/base/CMakeFiles/muduo_base.dir/AsyncLogging.cc.o ... [ 20%] Building CXX object examples/sudoku/CMakeFiles/sudoku_stat_unittest.dir/stat_unittest.cc.o [ 20%] Building CXX object muduo/net/CMakeFiles/muduo_net.dir/Buffer.cc.o [ 20%] Building CXX object muduo/net/CMakeFiles/muduo_net.dir/Channel.cc.o [ 21%] Building CXX object muduo/net/CMakeFiles/muduo_net.dir/Connector.cc.o [ 21%] Building CXX object muduo/net/CMakeFiles/muduo_net.dir/EventLoop.cc.o [ 21%] Building CXX object muduo/net/CMakeFiles/muduo_net.dir/EventLoopThread.cc.o [ 22%] Linking CXX executable ../../bin/sudoku_stat_unittest [ 22%] Built target sudoku_stat_unittest Scanning dependencies of target protobuf_dispatcher_lite_test [ 22%] Building CXX object examples/protobuf/codec/CMakeFiles/protobuf_dispatcher_lite_test.dir/dispatcher_lite_test.cc.o [ 22%] Building CXX object muduo/net/CMakeFiles/muduo_net.dir/EventLoopThreadPool.cc.o [ 23%] Building CXX object muduo/net/CMakeFiles/muduo_net.dir/InetAddress.cc.o [ 23%] Linking CXX executable ../../../bin/protobuf_dispatcher_lite_test ../../../lib/libquery_proto.a(query.pb.cc.o): In function muduo::Empty::~Empty()': /build/release-cpp11/examples/protobuf/codec/query.pb.cc:911: undefined reference togoogle::protobuf::UnknownFieldSet::~UnknownFieldSet()' ../../../lib/libquery_proto.a(query.pb.cc.o): In function muduo::Empty::~Empty()': /build/release-cpp11/examples/protobuf/codec/query.pb.cc:911: undefined reference togoogle::protobuf::UnknownFieldSet::~UnknownFieldSet()' /build/release-cpp11/examples/protobuf/codec/query.pb.cc:911: undefined reference to google::protobuf::Message::~Message()' ../../../lib/libquery_proto.a(query.pb.cc.o): In functionmuduo::Empty::SerializeWithCachedSizesToArray(unsigned char*) const': /usr/local/include/google/protobuf/io/coded_stream.h:1015: undefined reference to google::protobuf::io::CodedOutputStream::WriteVarint32FallbackToArray(unsigned int, unsigned char*)' ../../../lib/libquery_proto.a(query.pb.cc.o): In functionvoid google::protobuf::internal::RepeatedPtrFieldBase::Destroy<google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >::TypeHandler>() [clone .isra.44]': /usr/local/include/google/protobuf/repeated_field.h:869: undefined reference to google::protobuf::internal::StringTypeHandlerBase::Delete(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)' ../../../lib/libquery_proto.a(query.pb.cc.o): In functionmuduo::Answer::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*)': /usr/local/include/google/protobuf/io/coded_stream.h:924: undefined reference to google::protobuf::io::CodedInputStream::ReadTagFallback()' ../../../lib/libquery_proto.a(query.pb.cc.o): In functionmuduo::Answer::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*)': /build/release-cpp11/examples/protobuf/codec/query.pb.cc:607: undefined reference to google::protobuf::internal::WireFormatLite::ReadString(google::protobuf::io::CodedInputStream*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)' /build/release-cpp11/examples/protobuf/codec/query.pb.cc:624: undefined reference togoogle::protobuf::internal::WireFormatLite::ReadString(google::protobuf::io::CodedInputStream*, std::__cxx11::basic_string<char, std::char_traits, std::allocator >)' ../../../lib/libquery_proto.a(query.pb.cc.o): In function muduo::Answer::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*)': /usr/local/include/google/protobuf/repeated_field.h:905: undefined reference togoogle::protobuf::internal::StringTypeHandlerBase::Newabi:cxx11' ../../../lib/libquery_proto.a(query.pb.cc.o): In function muduo::Answer::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*)': /build/release-cpp11/examples/protobuf/codec/query.pb.cc:641: undefined reference togoogle::protobuf::internal::WireFormatLite::ReadString(google::protobuf::io::CodedInputStream, std::__cxx11::basic_string<char, std::char_traits, std::allocator >)' /build/release-cpp11/examples/protobuf/codec/query.pb.cc:641: undefined reference to google::protobuf::internal::WireFormatLite::ReadString(google::protobuf::io::CodedInputStream*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)' ../../../lib/libquery_proto.a(query.pb.cc.o): In functionmuduo::Answer::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream)': /usr/local/include/google/protobuf/io/coded_stream.h:809: undefined reference to google::protobuf::io::CodedInputStream::ReadVarint64Fallback(unsigned long*)' ../../../lib/libquery_proto.a(query.pb.cc.o): In functionmuduo::Empty::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*)': /usr/local/include/google/protobuf/io/coded_stream.h:924: undefined reference to google::protobuf::io::CodedInputStream::ReadTagFallback()' /usr/local/include/google/protobuf/io/coded_stream.h:799: undefined reference togoogle::protobuf::io::CodedInputStream::ReadVarint32Fallback(unsigned int*)' ../../../lib/libquery_proto.a(query.pb.cc.o): In function muduo::Query::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*)': /usr/local/include/google/protobuf/io/coded_stream.h:924: undefined reference togoogle::protobuf::io::CodedInputStream::ReadTagFallback()' ../../../lib/libquery_proto.a(query.pb.cc.o): In function muduo::Query::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*)': /usr/local/include/google/protobuf/repeated_field.h:905: undefined reference togoogle::protobuf::internal::StringTypeHandlerBase::Newabi:cxx11' ../../../lib/libquery_proto.a(query.pb.cc.o): In function muduo::Query::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*)': /build/release-cpp11/examples/protobuf/codec/query.pb.cc:279: undefined reference togoogle::protobuf::internal::WireFormatLite::ReadString(google::protobuf::io::CodedInputStream*, std::__cxx11::basic_string<char, std::char_traits, std::allocator >)' /build/release-cpp11/examples/protobuf/codec/query.pb.cc:279: undefined reference to google::protobuf::internal::WireFormatLite::ReadString(google::protobuf::io::CodedInputStream*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)' /build/release-cpp11/examples/protobuf/codec/query.pb.cc:262: undefined reference togoogle::protobuf::internal::WireFormatLite::ReadString(google::protobuf::io::CodedInputStream, std::__cxx11::basic_string<char, std::char_traits, std::allocator >)' ../../../lib/libquery_proto.a(query.pb.cc.o): In function muduo::Query::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*)': /usr/local/include/google/protobuf/io/coded_stream.h:809: undefined reference togoogle::protobuf::io::CodedInputStream::ReadVarint64Fallback(unsigned long)' ../../../lib/libquery_proto.a(query.pb.cc.o): In function muduo::Query::Query()': /build/release-cpp11/examples/protobuf/codec/query.pb.cc:163: undefined reference togoogle::protobuf::UnknownFieldSet::UnknownFieldSet()' /build/release-cpp11/examples/protobuf/codec/query.pb.cc:163: undefined reference to google::protobuf::Message::~Message()' /build/release-cpp11/examples/protobuf/codec/query.pb.cc:163: undefined reference togoogle::protobuf::UnknownFieldSet::~UnknownFieldSet()' ../../../lib/libquery_proto.a(query.pb.cc.o): In function muduo::Query::~Query()': /build/release-cpp11/examples/protobuf/codec/query.pb.cc:186: undefined reference togoogle::protobuf::UnknownFieldSet::~UnknownFieldSet()' ../../../lib/libquery_proto.a(query.pb.cc.o): In function muduo::Query::MergeFrom(muduo::Query const&)': /usr/local/include/google/protobuf/repeated_field.h:905: undefined reference togoogle::protobuf::internal::StringTypeHandlerBase::Newabi:cxx11' ../../../lib/libquery_proto.a(query.pb.cc.o): In function muduo::Query::Query(muduo::Query const&)': /build/release-cpp11/examples/protobuf/codec/query.pb.cc:172: undefined reference togoogle::protobuf::UnknownFieldSet::UnknownFieldSet()' /build/release-cpp11/examples/protobuf/codec/query.pb.cc:172: undefined reference to google::protobuf::Message::~Message()' /build/release-cpp11/examples/protobuf/codec/query.pb.cc:172: undefined reference togoogle::protobuf::UnknownFieldSet::~UnknownFieldSet()' ../../../lib/libquery_proto.a(query.pb.cc.o): In function muduo::Query::Swap(muduo::Query*)': /usr/local/include/google/protobuf/repeated_field.h:1188: undefined reference togoogle::protobuf::internal::RepeatedPtrFieldBase::Swap(google::protobuf::internal::RepeatedPtrFieldBase*)' ../../../lib/libquery_proto.a(query.pb.cc.o): In function muduo::Answer::Answer()': /build/release-cpp11/examples/protobuf/codec/query.pb.cc:499: undefined reference togoogle::protobuf::UnknownFieldSet::UnknownFieldSet()' /build/release-cpp11/examples/protobuf/codec/query.pb.cc:499: undefined reference to google::protobuf::Message::~Message()' /build/release-cpp11/examples/protobuf/codec/query.pb.cc:499: undefined reference togoogle::protobuf::UnknownFieldSet::~UnknownFieldSet()' ../../../lib/libquery_proto.a(query.pb.cc.o): In function muduo::Answer::~Answer()': /build/release-cpp11/examples/protobuf/codec/query.pb.cc:523: undefined reference togoogle::protobuf::UnknownFieldSet::~UnknownFieldSet()' ../../../lib/libquery_proto.a(query.pb.cc.o): In function muduo::Answer::MergeFrom(muduo::Answer const&)': /usr/local/include/google/protobuf/repeated_field.h:905: undefined reference togoogle::protobuf::internal::StringTypeHandlerBase::Newabi:cxx11' ../../../lib/libquery_proto.a(query.pb.cc.o): In function muduo::Answer::Answer(muduo::Answer const&)': /build/release-cpp11/examples/protobuf/codec/query.pb.cc:508: undefined reference togoogle::protobuf::UnknownFieldSet::UnknownFieldSet()' /build/release-cpp11/examples/protobuf/codec/query.pb.cc:508: undefined reference to google::protobuf::Message::~Message()' /build/release-cpp11/examples/protobuf/codec/query.pb.cc:508: undefined reference togoogle::protobuf::UnknownFieldSet::~UnknownFieldSet()' ../../../lib/libquery_proto.a(query.pb.cc.o): In function muduo::Answer::Swap(muduo::Answer*)': /usr/local/include/google/protobuf/repeated_field.h:1188: undefined reference togoogle::protobuf::internal::RepeatedPtrFieldBase::Swap(google::protobuf::internal::RepeatedPtrFieldBase*)' ../../../lib/libquery_proto.a(query.pb.cc.o): In function muduo::Empty::Empty()': /build/release-cpp11/examples/protobuf/codec/query.pb.cc:890: undefined reference togoogle::protobuf::UnknownFieldSet::UnknownFieldSet()' /build/release-cpp11/examples/protobuf/codec/query.pb.cc:890: undefined reference to google::protobuf::Message::~Message()' ../../../lib/libquery_proto.a(query.pb.cc.o): In functionmuduo::protobuf_AssignDesc_query_2eproto()': /build/release-cpp11/examples/protobuf/codec/query.pb.cc:58: undefined reference to google::protobuf::internal::GeneratedMessageReflection::GeneratedMessageReflection(google::protobuf::Descriptor const*, google::protobuf::Message const*, int const*, int, int, int, google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, int)' /build/release-cpp11/examples/protobuf/codec/query.pb.cc:76: undefined reference togoogle::protobuf::internal::GeneratedMessageReflection::GeneratedMessageReflection(google::protobuf::Descriptor const*, google::protobuf::Message const*, int const*, int, int, int, google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, int)' /build/release-cpp11/examples/protobuf/codec/query.pb.cc:91: undefined reference to google::protobuf::internal::GeneratedMessageReflection::GeneratedMessageReflection(google::protobuf::Descriptor const*, google::protobuf::Message const*, int const*, int, int, int, google::protobuf::DescriptorPool const*, google::protobuf::MessageFactory*, int)' ../../../lib/libquery_proto.a(query.pb.cc.o): In functionmuduo::Empty::Empty(muduo::Empty const&)': /build/release-cpp11/examples/protobuf/codec/query.pb.cc:899: undefined reference to google::protobuf::UnknownFieldSet::UnknownFieldSet()' /build/release-cpp11/examples/protobuf/codec/query.pb.cc:899: undefined reference togoogle::protobuf::Message::~Message()' /build/release-cpp11/examples/protobuf/codec/query.pb.cc:899: undefined reference to google::protobuf::UnknownFieldSet::~UnknownFieldSet()' ../../../lib/libquery_proto.a(query.pb.cc.o): In functionmuduo::Empty::~Empty()': /build/release-cpp11/examples/protobuf/codec/query.pb.cc:911: undefined reference to google::protobuf::Message::~Message()' ../../../lib/libquery_proto.a(query.pb.cc.o): In functionmuduo::Query::~Query()': /build/release-cpp11/examples/protobuf/codec/query.pb.cc:186: undefined reference to google::protobuf::Message::~Message()' ../../../lib/libquery_proto.a(query.pb.cc.o): In functionmuduo::Answer::~Answer()': /build/release-cpp11/examples/protobuf/codec/query.pb.cc:523: undefined reference to `google::protobuf::Message::~Message()' collect2: error: ld returned 1 exit status examples/protobuf/codec/CMakeFiles/protobuf_dispatcher_lite_test.dir/build.make:95: recipe for target 'bin/protobuf_dispatcher_lite_test' failed make[2]: *** [bin/protobuf_dispatcher_lite_test] Error 1 CMakeFiles/Makefile2:6142: recipe for target 'examples/protobuf/codec/CMakeFiles/protobuf_dispatcher_lite_test.dir/all' failed make[1]: *** [examples/protobuf/codec/CMakeFiles/protobuf_dispatcher_lite_test.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... [ 23%] Building CXX object muduo/net/CMakeFiles/muduo_net.dir/Poller.cc.o [ 23%] Building CXX object muduo/net/CMakeFiles/muduo_net.dir/poller/DefaultPoller.cc.o [ 24%] Building CXX object muduo/net/CMakeFiles/muduo_net.dir/poller/EPollPoller.cc.o [ 24%] Building CXX object muduo/net/CMakeFiles/muduo_net.dir/poller/PollPoller.cc.o [ 24%] Building CXX object muduo/net/CMakeFiles/muduo_net.dir/Socket.cc.o [ 24%] Building CXX object muduo/net/CMakeFiles/muduo_net.dir/SocketsOps.cc.o [ 25%] Building CXX object muduo/net/CMakeFiles/muduo_net.dir/TcpClient.cc.o [ 25%] Building CXX object muduo/net/CMakeFiles/muduo_net.dir/TcpConnection.cc.o [ 25%] Building CXX object muduo/net/CMakeFiles/muduo_net.dir/TcpServer.cc.o [ 25%] Building CXX object muduo/net/CMakeFiles/muduo_net.dir/Timer.cc.o [ 26%] Building CXX object muduo/net/CMakeFiles/muduo_net.dir/TimerQueue.cc.o [ 26%] Linking CXX static library ../../lib/libmuduo_net.a [ 26%] Built target muduo_net Makefile:140: recipe for target 'all' failed make: *** [all] Error 2
    opened by qinzhuzhu 1
  • Fuzzing: Add CIFuzz

    Fuzzing: Add CIFuzz

    Adds CIFuzz to muduo's OSS-fuzz integration. In short, CIFuzz is a service offered by OSS-fuzz to run muduo's fuzzers during the CI to prevent bugs from being introduced. In this PR the fuzz time is set to 600 seconds but can be changed.

    More about CIFuzz can be found here: https://google.github.io/oss-fuzz/getting-started/continuous-integration/

    opened by AdamKorcz 0
Releases(v2.0.2)
Netif - Header-only C++14 library for getting network addresses associated with network interface without name lookups on Windows, macOS, Linux, and FreeBSD

NetIF Get addresses associated with network interfaces on a system without using name lookups. Header-only, requires C++14. Usage Add the header file

GMLC-TDC 9 Feb 4, 2022
an easy implementation of a multi-process tcp server and a multi-thread tcp client

一个TCP多进程服务器-多线程客户端的简单实现。 客户端类似Apache ab的测试功能,能够通过向某一个ip端口发送指定并发量和总数量的tcp短连接;服务端处理tcp短连接,每来一条消息就打印一条log。 使用cmake编译,建议在vscode里编译,或者命令行 # 终端进入目录 mkdir bu

adin 1 Nov 28, 2021
bpflock - eBPF driven security for locking and auditing Linux machines

bpflock - Lock Linux machines bpflock - eBPF driven security for locking and auditing Linux machines. This is a Work In Progress: bpflock is currently

The Linux lock machine projects 64 Jun 7, 2022
Realtime Client/Server app for Linux allowing joystick (and other HID) data to be transferred over a local network

netstick What is it? Netstick enables HID devices to be remotely connected between a "client" and "server" over a network connection. It allows the ke

null 27 Jun 2, 2022
A modern C++ network library for developing high performance network services in TCP/UDP/HTTP protocols.

evpp Introduction 中文说明 evpp is a modern C++ network library for developing high performance network services using TCP/UDP/HTTP protocols. evpp provid

Qihoo 360 3k Jun 27, 2022
XMap is a fast network scanner designed for performing Internet-wide IPv6 & IPv4 network research scanning.

XMap is reimplemented and improved thoroughly from ZMap and is fully compatible with ZMap, armed with the "5 minutes" probing speed and novel scanning techniques. XMap is capable of scanning the 32-bits address space in under 45 minutes.

idealeer 172 Jun 10, 2022
WARFOX is a software-based HTTPS beaconing Windows implant that uses a multi-layered proxy network for C2 communications.

An HTTPS beaconing Windows implant and multi-layered proxy C2 network designed for covert APT emulation focused offensive operations

null 92 Jun 20, 2022
An HTTPS beaconing Windows implant and multi-layered proxy C2 network designed for covert APT emulation focused offensive operations

WARFOX is a software-based HTTPS beaconing Windows implant that uses a multi-layered proxy network for C2 communications. This kit was designed to emulate covert APT offensive operations. This kit includes WARFOX (Windows implant), HIGHTOWER (Listening Post), and other tools to build configs and set up a proxy network.

null 93 Jun 30, 2022
Mongoose Embedded Web Server Library - a multi-protocol embedded networking library with TCP/UDP, HTTP, WebSocket, MQTT built-in protocols, async DNS resolver, and non-blocking API.

Mongoose - Embedded Web Server / Embedded Networking Library Mongoose is a networking library for C/C++. It implements event-driven non-blocking APIs

Cesanta Software 8.5k Jun 29, 2022
Steve's Unreal Quest System: data-driven quest system for UE4

Steve's Unreal Quest System (SUQS) What Is It? SUQS is a simple, data-driven quest system for UE4. It helps you define quest structures for your game,

Steve Streeting 57 May 28, 2022
A network library for client/server games written in C++

yojimbo yojimbo is a network library for client/server games written in C++. It's designed around the networking requirements of competitive multiplay

The Network Protocol Company 2.1k Jun 17, 2022
single header C(99) library to implement client-server network code for games

single header C(99) library to implement client-server network code for games

Nathan 217 Jun 16, 2022
A software C library designed to extract data attributes from network packets, server logs, and from structured events in general, in order to make them available for analysis

MMT-DPI A software C library desinged to extract data attributes from network packets, server logs, and from structured events in general, in odrder t

Montimage 3 Apr 14, 2022
Header-only, event based, tiny and easy to use libuv wrapper in modern C++ - now available as also shared/static library!

Do you have a question that doesn't require you to open an issue? Join the gitter channel. If you use uvw and you want to say thanks or support the pr

Michele Caini 1.5k Jun 24, 2022
aria2 is a lightweight multi-protocol & multi-source, cross platform download utility operated in command-line.

aria2 is a lightweight multi-protocol & multi-source, cross platform download utility operated in command-line. It supports HTTP/HTTPS, FTP, SFTP, BitTorrent and Metalink.

aria2 26.7k Jun 22, 2022
A virtual network Differential GNSS server-client project using Precise Point Positioning (PPP). Global coverage. Without physical base station construction needed. An open-source virtual base station approach.

Virtual-Network-DGNSS-Project This project is the software implementation for a publicly available, open-source, client/server VN-DGNSS implementation

null 10 May 20, 2022
A cross-platform network learning demos. Like high-performance http server

Network-Learn A cross-platform network learning demos (toys). And I try not to use 3rd-party libraries. Welcome to try it out and leave your comments.

Ho 229 24 Apr 15, 2022
Like libevent and libuv, libhv provides event-loop with non-blocking IO and timer, but simpler api and richer protocols.

中文版 Intro Like libevent, libev, and libuv, libhv provides event-loop with non-blocking IO and timer, but simpler api and richer protocols. Features cr

ithewei 4.3k Jun 24, 2022
Event loop friendly C++ actor micro-framework

Rotor rotor is event loop friendly C++ actor micro framework, github gitee features minimalistic loop agnostic core erlang-like hierarchical superviso

Ivan Baidakou 218 Jun 23, 2022