Giter Site home page Giter Site logo

boost-beast-chatserver-test's Introduction

Boost Beast Chatserver Test

This project is just for me to experiment with Boost Asio and Boost Beast.

Rules

Here are some self-imposed 'rules' that I think are worth abiding by when it comes to Boost Asio/Beast.

  1. Model different async objects as finite state machines. Each state is a completion handler for an async operation, and when performed, launches other async calls.
  2. State completion handlers should not throw exceptions. When something bad happens, it's probably useful to log it somewhere, and then the object can destroy itself by simply not transitioning to a new state.
  3. There is an interesting distinction between objects which expose some async APIs (in this case, server::Server and websocket::Session) and those which don't. Those which don't can often be represented using std::unique_ptr, and basically have no function other than make_and_run. Those which do will probably have to be represented using a std::shared_ptr, and will need to serialise their operations via a strand (as the async ops could be called from anywhere.) Moreover, these are the only objects which will need to return themselves from make_and_run.
  4. How to bring async testing into this? We'll probably need template parameters for all stream/connection-like objects. Doing this is probably quite intrusive, but very useful and necessary.

boost-beast-chatserver-test's People

Watchers

Samuel Barrett avatar

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.