GithubHelp home page GithubHelp logo

glynos / cpp-netlib Goto Github PK

View Code? Open in Web Editor NEW
238.0 33.0 583.0 7.68 MB

The C++ Network Library Project -- header-only, cross-platform, standards compliant networking library.

Home Page: http://glynos.github.com/cpp-netlib/

License: Boost Software License 1.0

C++ 55.63% Python 1.26% Shell 0.20% CMake 1.58% HTML 33.97% Makefile 0.19% CSS 1.61% JavaScript 5.37% Batchfile 0.19%

cpp-netlib's Introduction

C++ Network Library

Modern C++ network programming libraries.

https://travis-ci.org/cpp-netlib/cpp-netlib.svg?branch=master

Join us on Slack: http://slack.cpp-netlib.org/

Subscribe to the mailing list: https://groups.google.com/forum/#!forum/cpp-netlib

Downloading cpp-netlib

You can find official release packages of the library at:

http://github.com/cpp-netlib/cpp-netlib/downloads

If you want the latest code from the master branch of the project, you can follow these instructions for cloning the project repository:

$ git clone https://github.com/cpp-netlib/cpp-netlib
$ cd cpp-netlib
$ git submodule init
$ git submodule update

Introduction

cpp-netlib is a collection of network-related routines/implementations geared towards providing a robust cross-platform networking library. cpp-netlib offers the following implementations:

  • Common Message Type -- A generic message type which can be used to encapsulate and store message-related information, used by all network implementations as the primary means of data exchange.
  • Network protocol message parsers -- A collection of parsers which generate message objects from strings.
  • Adapters and Wrappers -- A collection of Adapters and wrappers aimed towards making the message type STL friendly.
  • Network protocol client and server implementations -- A collection of network protocol implementations that include embeddable client and server types.

This library is released under the Boost Software License (please see http://boost.org/LICENSE_1_0.txt or the accompanying LICENSE_1_0.txt file for the full text.

Building and Installing

To build the libraries you will need to have CMake version 2.8 or higher installed appropriately in your system.

$ cmake --version
cmake version 2.8.1

It is recommended that you build cpp-netlib outside of the source directory, to avoid having issues with CMake generated files polluting the source directory:

$ mkdir ~/cpp-netlib-build
$ cd ~/cpp-netlib-build
$ cmake -DCMAKE_BUILD_TYPE=Debug     \
>       -DCMAKE_C_COMPILER=clang     \
>       -DCMAKE_CXX_COMPILER=clang++ \
>       $HOME/cpp-netlib    # we're assuming this is where cpp-netlib is.

Once CMake is done with generating the Makefiles and configuring the project, you can now build the tests and run them:

$ cd ~/cpp-netlib-build
$ make
$ make test

If for some reason some of the tests fail, you can send the files in Testing/Temporary/ as attachments to the cpp-netlib developers mailing list.

Running Tests

If you want to run the tests that come with cpp-netlib, there are a few things you will need. These are:

  • A compiler (GCC 4.x, Clang 3.6, MSVC 2008)
  • A build tool (CMake is required)
  • OpenSSL headers (optional)

Note

This assumes that you have cpp-netlib at the top-level of your home directory.

Hacking on cpp-netlib

cpp-netlib uses git for tracking work and is hosted on GitHub. cpp-netlib is hosted on GitHub following the GitHub recommended practice of forking the repository and submitting pull requests to the source repository. You can read more about the forking process and submitting pull requests if you're not familiar with either process yet. cpp-netib follows the GitHub pull request model for accepting patches. You can read more about the process at http://cpp-netlib.org/process.html#pull-requests.

Because cpp-netlib is released under the Boost Software License it is recommended that any file you make changes to bear your copyright notice alongside the original authors' copyright notices on the file. Typically the copyright notices are at the top of each file in the project.

You can read about the cpp-netlib style guide at http://cpp-netlib.org/style-guide.html.

The main "upstream" repository is at http://github.com/cpp-netlib/cpp-netlib.

Contact and Support

In case you have any questions or would like to make feature requests, you can contact the development team through the developers mailing list or by filing issues at http://github.com/cpp-netlib/cpp-netlib/issues.

Join us on Slack: http://slack.cpp-netlib.org/

You can reach the maintainers of the project through:

Dean Michael Berris ([email protected])

Glyn Matthews ([email protected])

cpp-netlib's People

Contributors

3noch avatar anonimal avatar burannah avatar chenzhaoyu avatar cnagune avatar codemedic avatar danielbujnik avatar deanberris avatar dvd0101 avatar eakraly avatar el-bart avatar gjasny avatar glynos avatar igorpeshansky avatar infinity0 avatar jellevdd avatar kaspervandenberg avatar leecoder avatar lyytinen avatar mike-ect avatar nabagata avatar omalashenko avatar patlecat avatar povilasb avatar prantlf avatar susnux avatar tjadevries avatar umennel avatar vexocide avatar wujunzhuo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cpp-netlib's Issues

Constants should be header only

To do:

  • Remove "methods" namespace as it is duplicated in the methods.hpp header.
  • Make the status codes an enum class.
  • Maybe remove the headers for now, these don't need to be constants, I think.

[Docs] Create an appendix for concepts

All concept definitions belong in the appendix because, although the information is important, it is not easily readable and breaks up the flow of the text.

Fetched in submodule path 'libs/network/doc/_ext/breathe'

When I type cmd "git submodule update",then I got the log below:

Cloning into '.../cpp-netlib/deps/asio'...
Cloning into '.../cpp-netlib/deps/cxxopts'...
Cloning into '.../cpp-netlib/deps/googlemock'...
Cloning into '.../cpp-netlib/deps/googletest'...
Cloning into '.../cpp-netlib/deps/uri'...
Cloning into '.../cpp-netlib/libs/network/doc/_ext/breathe'...
Submodule path 'deps/asio': checked out '66e76b9e4252ff4681227d0d8e34374ec1fa20e5'
Submodule path 'deps/cxxopts': checked out 'aec97a6f53c3486fc51e0d9857f10b683180d668'
Submodule path 'deps/googlemock': checked out 'f7d03d2734759ee12b57d2dbcb695607d89e8e05'
Submodule path 'deps/googletest': checked out 'd225acc90bc3a8c420a9bcd1f033033c1ccd7fe0'
Submodule path 'deps/uri': checked out 'c16a46ecb6bf0c936179e324891a74b5e6d8f4d3'
error: Server does not allow request for unadvertised object 853385ef4f0c3dd126887750e20d5f7456065998
Fetched in submodule path 'libs/network/doc/_ext/breathe', but it did not contain 853385ef4f0c3dd126887750e20d5f7456065998. Direct fetching of that commit failed.

Implement a base 64 encoder for the request byte source

request r{“http://www.example.com”,
          base64_encode(new file_byte_source{“/tmp/input”})};

So the base64_encode function would look like this:

template <class ByteSource>
auto gzip_encode(ByteSource* source) -> shared_ptr<gzip_encoder<ByteSource>> {
  shared_ptr<gzip_encoder<ByteSource>> ptr{new gzip_encoder<ByteSource>(source)};
  return ptr;
}

Implement byte source in HTTP request

The API of the request class should be something like this:

struct request {
  request(uri, shared_ptr<byte_source>=nullptr);
  void set_body_source(shared_ptr<byte_source>);
  // ...
};

and for the byte_source class itself:

struct byte_source {
  virtual ~byte_source() noexcept = 0;
  virtual size_t read(string&, size_t) = 0;
};

We can test using mock_byte_source class.

Creating a Contributor's Guide

Hi everyone,

When fixing bugs in branch master, I found out too late that they were resolved in 0.12-release and 0.13-release. When wanting to PR other contributions, I could not find clear documentation that indicated which branch to PR too.

I'm wondering if a basic contributor's guide would be helpful to the project. Something that indicates workflow and/or any desired protocol. If the guide also included any style considerations, that would be helpful (our guide is under development but has been helpful so far).

Referencing our interest in cpp-netlib.

Error C2039: "value" is not a member of "boost::prot"

I installed boost and cpp-netlib using vcpkg,but when I'm using it by #include “boost/network/uri.hpp" ,I got error C2039.The error is reported at "F:\vcpkg\installed\x64-windows\include\boost\proto\generate.hpp",in line239 and line 248.
IDE: Viaual Studio Professional 2019
System: Windows 10 x64

Body callback function is not called when some errors occur (timeout etc.)

When using cpp-netlib-0.11.2-final and async client with body callback function:

boost::network::http::client::options options;
options.timeout( timeout_seconds );
options.follow_redirects( true );

boost::network::http::client client( options );
client.get( request, callback );

The callback is not called when some network etc. errors occur. I observed it that when timeout should occur my callback function is still not called, but when I looked at cpp-netlib's async_normal.hpp file I found not only for timeout, but in many places in which body_promise IS set (either to empty value or exception), but callback either IS NOT called at all, or is called with uninitialized boost::system::error_code instead of the same error code body_promise was set, which would make my own callback function expect another call instead of finish the processing (since uninitialized error_code means no error occurred and we are still waiting for boost::asio::error::eof or other error to finish the processing).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.