Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Use Libasyncd in more then one thread #38

@Roma004

Description

@Roma004

Hello there! I'm currently trying to write multithreaded servers in C++ and decided to use Libasyncd, as it seemed simple and straightforward to work with. I already managed to write a simple http server following the examples, but it looks like your library only allows it to work in one thread.
I also tried changing the "server.thread" setting to "1", but this just caused the server to stop working without any errors. Apparently, it is not sent to a separate thread, as well as it is not launched in several threads, since when sending a request into the url of my server, I get "Connection refused".
So, my question is:

  1. (most importantly) is it possible to use this library to start the server in several(let's say in 4) threads, without running the code 4 times in 4 different sessions?
  2. what is the "server.thread" parameter responsible for, how should it work, and when should it be used? This was not clear
    from the documentation.
  3. if you can't use multithreading using the library, can you suggest different ways to solve this problem?

I would be very grateful if I get answers to these questions! Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions